Closed sunaifei closed 2 years ago
As of a few days ago, there was something wrong with pip
and or setuptools
. Specifically, python -m pip ...
thus failed but pip ...
still worked. The problem is now fixed but to get the fix you have to invoke something like pip install -U pip setuptools
without the leading python -m
. (Depending on your setup, that fist pip
might instead have to be pip3
.)
setuptools 60.6.0 had a bug, since fixed (see their issue 3063).
When I run the devops scripts, I met problem
Step 6/23 : RUN curl --silent https://bootstrap.pypa.io/get-pip.py -O && python3 get-pip.py && python3.8 get-pip.py && rm get-pip.py && which pip && which python && pip --version && python --version && which pip3 && which python3 && pip3 --version && python3 --version && find / -xdev -name '*.py[oc]' -type f -exec rm {} + && find / -xdev -name pycache -type d -exec rm -r {} +
---> Running in 3d97ced5fa7a Collecting pip Downloading pip-21.3.1-py3-none-any.whl (1.7 MB) Collecting setuptools Downloading setuptools-60.3.1-py3-none-any.whl (953 kB) Collecting wheel Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB) Installing collected packages: wheel, setuptools, pip Successfully installed pip-21.3.1 setuptools-60.3.1 wheel-0.37.1 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Collecting pip Using cached pip-21.3.1-py3-none-any.whl (1.7 MB) Installing collected packages: pip Attempting uninstall: pip Found existing installation: pip 21.3.1 Uninstalling pip-21.3.1: Successfully uninstalled pip-21.3.1 Successfully installed pip-21.3.1 /usr/local/lib/python3.8/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( /usr/local/lib/python3.8/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( /usr/local/lib/python3.8/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
/usr/bin/pip /usr/local/bin/python Traceback (most recent call last): File "/usr/bin/pip", line 5, in
from pip import main
ModuleNotFoundError: No module named 'pip'