Because the working environment is centos6.X and the python that comes with the system is 2.6, it does not support many new modules very well. So download and compile python2.7.13 and then link to the python2.7 command. After downloading get-pip.py and running it using python2.7, it will be prompted that it has been installed under site-packages in the python2.7 installation directory. However, the command was not found when entering pip (it should be a non-system version, and no connection was created). I would like to ask how to operate now. pip only needs to install modules for python2.7, and the system's native python will not touch it.
Python multi-version management tool, it is recommended to use pyenv
You can make a soft connection to the pip corresponding to python2.7 called
pip27
. Just don’t conflict with the system default one. If you want to install the module, use pip27 to install it on python27You need to know where you are using
pip
and whether it has been added to the environment variablesYou can use python (27 version of python) -m pip to call pip
You can also change the python soft connection, but it may be risky, because some system software may use the system's python, so using a soft connection like python27 is a better method
Use pyenv, but be aware that it may modify the system python, and it also has python shell/local/global configuration.