I'm using pip 24.2 and Python 3.12.4. I want to install this:
$ pip install RandomWords
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
python setup.py egg_info did not run successfully.
exit code: 1
from setuptools.command.test import test as TestCommand
ModuleNotFoundError: No module named 'setuptools.command.test'
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Why is this and how can I fix it?
It seems that their package is broken. This is because in setup.py
they are doing
from setuptools.command.test import test as TestCommand
but setuptools.command.test
was removed on 28 Jul 2024 (yesterday):
https://setuptools.pypa.io/en/stable/history.html#v72-0-0
Here's a similar issue on the official GitHub repo: https://github.com/pypa/setuptools/issues/4519
To solve it locally do one of the following:
setuptools
as @reza.safiyat suggested;setuptools = "<72.0.0"
.setuptools 72.0.0
has been yanked (https://pypi.org/project/setuptools/72.0.0/#history) and the removal of command.test
has been postponed to November 15.
Everything should work as it did yesterday (with the addition of a new big warning, hopefully).
This module was removed from in this commit.
Using setuptools<72.0.0
will alleviate this problem.
Steps you may use once you have sourced the relevant python environment:
# Install setuptools below v72.0.0. Add `-U` after `install` in case you want to upgrade to a version below 72.0.0, if you already have setuptools installed.
python -m pip install 'setuptools<72.0.0'
# Install RandomWords.
python -m pip install RandomWords
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With