CentOS 6.5安装Python2.7.14(2)

至此,新版 Python 即算安装完毕了。
注意:这可能会导致以前安装过的 Python 程序运行不了或者无法重启之类的(比如著名的 Shadowsocks Python 版)。原因是旧版的 pkg_resources 位于 /usr/lib/python2.6/site-packages 下。而新版的则是在 /usr/local/lib/python2.7/site-packages 下。
所以,我们需要将python2.6下site-packages目录中的文件拷贝到python2.7/site-packages下。

cp -r /usr/lib/python2.6/site-packages/yum /usr/local/lib/python2.7/site-packages/ 
cp -r /usr/lib/python2.6/site-packages/rpmUtils /usr/local/lib/python2.7/site-packages/ 
cp -r /usr/lib/python2.6/site-packages/iniparse /usr/local/lib/python2.7/site-packages/ 
cp -r /usr/lib/python2.6/site-packages/urlgrabber /usr/local/lib/python2.7/site-packages/ 
cp -r /usr/lib64/python2.6/site-packages/rpm /usr/local/lib/python2.7/site-packages/ 
cp -r /usr/lib64/python2.6/site-packages/curl /usr/local/lib/python2.7/site-packages/ 
cp -p /usr/lib64/python2.6/site-packages/pycurl.so /usr/local/lib/python2.7/site-packages/ 
cp -p /usr/lib64/python2.6/site-packages/_sqlitecache.so /usr/local/lib/python2.7/site-packages/ 
cp -p /usr/lib64/python2.6/site-packages/sqlitecachec.py /usr/local/lib/python2.7/site-packages/ 
cp -p /usr/lib64/python2.6/site-packages/sqlitecachec.pyc /usr/local/lib/python2.7/site-packages/ 
cp -p /usr/lib64/python2.6/site-packages/sqlitecachec.pyo /usr/local/lib/python2.7/site-packages/

Python 装饰器详解 

Python 使用期物处理并发 

Ubuntu 16.04下安装Vim8并支持Python3 

CentOS 6.4下安装Python3 

Python升级导致yum不可用 “ No module named yum” 

Python 网络框架Twisted基础学习及详细讲解 

CentOS7保留默认Python版本并安装更新Python2和Python3共存 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/13052.html