Centos 5.5 python 2.4升级python 2.6.6
2013-05-24 21:40
507 查看
Centos 5.5默认没有安装sqlite-devel,所以要先安装sqlite-devel,在编译升级python,才可以使用sqlite3。
1.先安装sqlite-devel:
[root@localhost ~]#yum install sqlite-devel -y
2.下载编译安装python2.6.6
[root@localhost ~]#wget -c http://www.python.org/ftp/python/2.6.6/Python-2.6.6.tar.bz2 [root@localhost ~]#tar jxvf Python-2.6.6.tar.bz2
[root@localhost ~]#cd Python-2.6.6
[root@localhost Python-2.6.6]#./configure --with-threads --enable-shared //默认安装路径:/usr/local/lib/
[root@localhost Python-2.6.6]#make && make install
3.修改系统默认版本
[root@localhost Python-2.6.6]#mv /usr/bin/python /usr/bin/python.bak
[root@localhost Python-2.6.6]#ln -s /usr/local/bin/python2.6 /usr/bin/python
[root@localhost Python-2.6.6]#python -V
Python 2.6.6
4.解决系统python软链接指向python2.6版本后,yum不能正常工作
[root@localhost Python-2.6.6]#vim /usr/bin/yum
#!/usr/bin/python
修改为#!/usr/bin/python2.4
5.如果需要在次编译报错的解决办法
报错信息:python: error while loading shared libraries: libpython2.6.so.1.0: cannot open shared object file: No such file or directory
解决办法:
[root@localhost ~]# vim /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib ===》需要添加
[root@localhost ~]# ldconfig
[root@localhost ~]# python -V
Python 2.6.6
本文出自 “斯图尔特” 博客,请务必保留此出处http://stuart.blog.51cto.com/728677/1209419
1.先安装sqlite-devel:
[root@localhost ~]#yum install sqlite-devel -y
2.下载编译安装python2.6.6
[root@localhost ~]#wget -c http://www.python.org/ftp/python/2.6.6/Python-2.6.6.tar.bz2 [root@localhost ~]#tar jxvf Python-2.6.6.tar.bz2
[root@localhost ~]#cd Python-2.6.6
[root@localhost Python-2.6.6]#./configure --with-threads --enable-shared //默认安装路径:/usr/local/lib/
[root@localhost Python-2.6.6]#make && make install
3.修改系统默认版本
[root@localhost Python-2.6.6]#mv /usr/bin/python /usr/bin/python.bak
[root@localhost Python-2.6.6]#ln -s /usr/local/bin/python2.6 /usr/bin/python
[root@localhost Python-2.6.6]#python -V
Python 2.6.6
4.解决系统python软链接指向python2.6版本后,yum不能正常工作
[root@localhost Python-2.6.6]#vim /usr/bin/yum
#!/usr/bin/python
修改为#!/usr/bin/python2.4
5.如果需要在次编译报错的解决办法
报错信息:python: error while loading shared libraries: libpython2.6.so.1.0: cannot open shared object file: No such file or directory
解决办法:
[root@localhost ~]# vim /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib ===》需要添加
[root@localhost ~]# ldconfig
[root@localhost ~]# python -V
Python 2.6.6
本文出自 “斯图尔特” 博客,请务必保留此出处http://stuart.blog.51cto.com/728677/1209419
相关文章推荐
- Centos 5.5升级Python2.4到3.3版本
- centos5.5_x64 升级Python2.4到2.7
- Centos6.5 python2.6.6升级2.7.13,安装setuptools和pip
- centos6.5将python2.6.6升级到python2.7以及easy_install和pip
- CentOS中升级 Python2.4 至2.6版本
- CentOS5.8 升级python至2.6.6 并安装ansible
- CentOS 5.5 中 Python 升级到 2.6.5 | 落
- centOS 6.4 升级python 2.6.6 to 2.7.3
- CentOS6.4升级python2.6.6到3.3.0
- CentOS 5.5 x64下安装升级Python3.3
- (转)CentOS 5.5 中 Python 升级到 2.6.5
- SL5.5 (CentOS5.5)python升级导致
- centos6.3系统python2.6.6升级到python2.7.9
- centos 5.8升级python 2.4到2.7
- centos6.5系统将Python2.6.6升级到3.6.3版本
- centos升级python(从2.6.6升级到2.7.8)
- Centos 5.5升级Python到2.7版本
- CentOS环境 升级Python2.6.6至2.7.5
- Centos 6.8升级Python2.6.6至2.7.8
- Centos 6.4升级Python 2.6.6到Python 3.3.3