-
-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Installation fails: ModuleNotFoundError: No module named 'setuptools'
#619
Comments
I just ran into this as well, also on an Arch Linux based distro. Python 3.10.5 and pip 22.1.2. I was able to fix this by doing I can't seem to figure out how to fix the environment in general so that I don't have to manually do this for every |
The only fix for this bug right now is to use Could any maintainers of pendulum explain why was a poetry preview version required now to install pendulum as a dependancy ? |
This looks like a known issue per pypa/pip#6264 (comment), which is not python-poetry specific, but triggered by pip when
It seems from that bug that upgrading your interpreter's In a brief test, I didn't see this issue with an up-to-date setuptools install. Installation of `pendulum==2.1.2` into a venv
It's also possible that adding You might also find that setting the env-var |
Can not reproduce this with any supported python version, all install |
Repro case for my diagnosis above, with fresh python 3.8.0. (I intended to grab 3.8 latest, but was inattentive...) Specifically, I have not run the following, which is usually the first thing I do with a new Python setup:
> py -3.8 -m pip list
Package Version
---------- -------
pip 19.2.3
setuptools 41.2.0
WARNING: You are using pip version 19.2.3, however version 22.2.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
> py -3.8 -m venv pendvenv
> which python
C:\Users\paulh\pendvenv\Scripts\python.exe
> .\pendvenv\Scripts\activate
> python -m pip list
Package Version
---------- -------
pip 19.2.3
setuptools 41.2.0
WARNING: You are using pip version 19.2.3, however version 22.2.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
> python -m pip install "pendulum==2.1.2" --no-binary pendulum
Collecting pendulum==2.1.2
Downloading https://files.pythonhosted.org/packages/db/15/6e89ae7cde7907118769ed3d2481566d05b5fd362724025198bb95faf599/pendulum-2.1.2.tar.gz (81kB)
|████████████████████████████████| 81kB 5.1MB/s
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Requirement already satisfied: pytzdata>=2020.1 in c:\users\paulh\pendvenv\lib\site-packages (from pendulum==2.1.2) (2020.1)
Requirement already satisfied: python-dateutil<3.0,>=2.6 in c:\users\paulh\pendvenv\lib\site-packages (from pendulum==2.1.2) (2.8.2)
Requirement already satisfied: six>=1.5 in c:\users\paulh\pendvenv\lib\site-packages (from python-dateutil<3.0,>=2.6->pendulum==2.1.2) (1.16.0)
Skipping bdist_wheel for pendulum, due to binaries being disabled for it.
Installing collected packages: pendulum
Running setup.py install for pendulum ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\paulh\pendvenv\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\paulh\\AppData\\Local\\Temp\\pip-install-mdamxxr8\\pendulum\\setup.py'"'"'; __file__='"'"'C:\\Users\\paulh\\AppData\\Local\\Temp\\pip-install-mdamxxr8\\pendulum\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\paulh\AppData\Local\Temp\pip-record-k5rp6mo7\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\paulh\pendvenv\include\site\python3.8\pendulum'
cwd: C:\Users\paulh\AppData\Local\Temp\pip-install-mdamxxr8\pendulum\
Complete output (3 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'setuptools'
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\paulh\pendvenv\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\paulh\\AppData\\Local\\Temp\\pip-install-mdamxxr8\\pendulum\\setup.py'"'"'; __file__='"'"'C:\\Users\\paulh\\AppData\\Local\\Temp\\pip-install-mdamxxr8\\pendulum\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\paulh\AppData\Local\Temp\pip-record-k5rp6mo7\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\paulh\pendvenv\include\site\python3.8\pendulum' Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 22.2.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command. A quick check in Git suggests this still affects latest 3.7, but per python/cpython#88096 has been fixed in latest 3.8 and 3.9 (by upgrading setuptools), and per python/cpython#87243 should have been fixed in 3.10 alpha series. The original poster shows pip 22.0.4 (which suggests setuptools would also have been new-enough), so possibly there was another issue that leads to the same failure, and my diagnosis was wrong. On the other hand, I just noticed that the original poster was on Arch Linux, and the pip 22.0.4 was running from a venv (while Poetry was installed in /usr/lib...) so perhaps the setuptools (and pip) in /usr/lib is too old, because it's being managed by the Linux vendor, and did not keep up with the Edit: Confirmed that Arch Linux disables ensurepip, and never had a python-pip 22.0.4 package, so the version in the venv is (presumably) newer than what was on the system. However, it doesn't appear that Arch's python-pip package specifies a versioned dependency on setuptools, so it's definitely possible that an old So I'd say my diagnosis is feasible, but to prove it, we'd need the list of python packages installed on that system and expect to see a |
This is a poetry bug |
Issue
I am trying to install another package, but it features pendulum as one of its dependencies. Installation fails with the following error:
Error
Setup also fails when I do it using pip instead of Poetry.
I have searched thoroughly, I tried installing setuptools and wheel both inside venv, globally and as root, upgrading pip and poetry. Nothing worked for me.
My setup:
Any help appreciated. Thank you.
The text was updated successfully, but these errors were encountered: