1. Problem source: Python 2 PIP tool is not installed by default in CentOS. The version of Python PIP tool installed directly is 8.1.0, which is very old.
Download and install PIP for python2 using the following command
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
python get-pip.py
Note: the following command downloads and installs PIP for Python 3
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
Update PIP with the command PIP install -- upgrade PIP
Update setuptools with the command PIP install -- upgrade setuptools
2. If the PIP is linked to a python 3 pip, you can first use which PIP
to obtain the file to which the current pip is linked. For example, PIP
the possible paths are /usr/bin/PIP
or /usr/local/bin/PIP
, and then use sudo VIM/usr/bin/PIP
or sudo VIM/usr/local/bin/PIP
to modify, The documents before modification are as follows:
#!/usr/bin/python3
……
After modification, it is mainly to change python3
in the first line to python2
:
#!/usr/bin/python2
……
Then save and exit.
Similar Posts:
- Zsh: command not found: pip3 & pip [How to Solve]
- Python Via get-pip.py Install pip Error: zipimport.ZipImportError: can‘t decompress data; zlib not availabl
- How to Solve ModuleNotFoundError: No module named ‘pip._internal’
- ImportError No module named setuptools [How to Solve]
- [Solved] python Install pip Error: zipimport.ZipImportError: can’t decompress data; zlib not available
- How to install PIP in no module named setuptools
- Python compiles and installs under Linux and reports an error: makefile: 1141: install
- Solve the problem of Command “python setup.py egg_info” failed with error code 1
- AttributeError: ‘module’ object has no attribute ‘main’
- PIP installation appears command “Python setup. Py egg”_ Info” failed with error code 1