码迷,mamicode.com
首页 > 编程语言 > 详细

centos6.5 升级python2.7.6

时间:2015-11-30 18:15:10      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:centos   python   2.7.6   

cd /data/tools

wget http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz

# tar xvzf Python-2.7.6.tgz

# cd Python-2.7.6

# ./configure --prefix=/usr/local --enable-shared

# make && make install



安装了python2.7,第一次执行时报错:

error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory


解决方法如下:

find / -name libpython2.7.so.1.0

vi /etc/ld.so.conf 

添加上python2.7的lib库地址,如我的/usr/local/lib,保存文件

 /sbin/ldconfig -v


#mv /usr/bin/python /usr/bin/python2.6.6  

#ln -s /usr/local/bin/python2.7 /usr/bin/python  

python -V 

vi /usr/bin/yum  

将文件头部的
#!/usr/bin/python

改成
#!/usr/bin/python2.6.6


本文出自 “智能化未来_XFICC” 博客,请务必保留此出处http://xficc.blog.51cto.com/1189288/1718150

centos6.5 升级python2.7.6

标签:centos   python   2.7.6   

原文地址:http://xficc.blog.51cto.com/1189288/1718150

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!