首页 > 编程语言 > 详细

python 版本升级(CentOS) 从2.6.6升级到2.7.6

时间:2015-07-14 22:26:04      阅读:291      评论:0      收藏:0      [点我收藏+]
 1 #升级前必须先安装其它依赖
 2 yum install readline-devel sqlite-devel bzip2-devel openssl-devel gdbm-devel libdbi-devel ncurses-libs zlib-devel -y
 3 #下载python安装包
 4 wget https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz
 5 tar -zxvf Python-2.7.6.tgz
 6 cd Python-2.7.6
 7 ./configure --prefix=/usr/local/python2.7
 8 make && make install
 9 make clean
10 make distclean
11 #移除旧的Python链接
12 mv /usr/bin/python /usr/bin/python2.6.6
13 
14 ln -s /usr/local/python2.7/bin/python2.7 /usr/bin/python
15 #安装setuptools
16 cd ..
17 wget http://pypi.douban.com/packages/source/s/setuptools/setuptools-12.0.5.tar.gz
18 tar zxvf setuptools-12.0.5.tar.gz
19 cd setuptools-12.0.5
20 python setup.py build
21 python setup.py install
22 #手动设置环境变量
23 #vi /etc/profile
24 #添加如下内容:
25 #PY_EZ=/usr/local/python2.7
26 #export PATH=$PY_EZ/bin:$PATH
27 #source /etc/profile  # 当前终端生效,reboot后才会完全生效
28 #echo $PATH
29 #查找easy_install
30 #find / -name easy_install
31 #ln -s /usr/local/python2.7/bin/easy_install /usr/bin/easy_install
32 #easy_install pip
33 #find / -name pip
34 #

 

python 版本升级(CentOS) 从2.6.6升级到2.7.6

原文:http://www.cnblogs.com/wanernet/p/4646587.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!