Im trying to install a venv
in python3
(on CentOS
). However i get the following error:
Error: Command ‘[‘/home/cleared/Develop/test/venv/bin/python3’, ‘-Im’,
‘ensurepip’, ‘–upgrade’, ‘–default-pip’]’ returned non-zero exit
status 1.
I guess there is some problem with my ensurepip
…
Running python3 -m ensurepip
results in
FileNotFoundError: [Errno 2] No such file or directory:
‘/usr/lib64/python3.6/ensurepip/_bundled/pip-9.0.3-py2.py3-none-any.whl’
Looking in the /usr/lib64/python3.6/ensurepip/_bundled/
I find pip-18.1-py2.py3-none-any.whl
and setuptools-40.6.2-py2.py3-none-any.whl
, however no pip-9.0.3-py2.py3-none-any.whl
Running pip3 --version
gives
pip 20.0.1 from /usr/local/lib/python3.6/site-packages/pip (python
3.6)
Why is it looking for pip-9.0.3-py2.py3-none-any.whl when I’m running pip 20.0.1, and why to i have pip-18.1-py2.py3-none-any.whl? And how to I fix this?
2
Answers
These versions are harcoded at the beginning of
./lib/python3.8/ensurepip/__init__.py
. You can edit this file with the correct ones.Regarding the reason of this corruption, I can only guess. I would bet on a problem during the installtion of this interpreter.
I would make a clean reinstall of Python (and maybe some of its dependencies as well) with your operating system’s package manager (yum?).