This article is a mirror article of machine translation, please click here to jump to the original article.

View: 14733|Reply: 1

[Source] pip execution error caused by python upgrade

[Copy link]
Posted on 12/7/2016 4:06:49 PM | | |
centos5.x defaults to python version 2.4, but some software requires python above 2.5.
So we need to upgrade Python, for example, to version 2.7, steps
curl -O http://python.org/ftp/python/2.7/Python-2.7.tgz  
tar xfz Python-2.7.tgz  
cd Python-2.7  
./configure  
make && make install

Replace /usr/bin/python with a python 2.7 softlink
ln -s /usr/local/bin/python2.7.3 /usr/bin/python

Check the version with python -V.

But the problem is that after upgrading python, the originally installed pip may encounter errors, as follows:

So pip also needs to be upgraded to the supporting version:
curl -O http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
sh setuptools-0.6c11-py2.7.egg

easy_install pip
Now look at the pip under the /usr/local/bin directory:
[root@dev1 bin]# ll /usr/local/bin |grep pip
-rwxr-xr-x 1 root root     250 Oct 18 17:23 pip
-rwxr-xr-x 1 root root     258 Oct 18 17:23 pip-2.7

Use pip-2.7.





Previous:nginx sets up proxy caching
Next:Upgrade Python 2.6.6 to 2.7.5 on Centos 6.4 system
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com