神剑山庄资源网 Design By www.hcban.com
1. 准备工作
下载源码包
wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
查看是否安装make工具
~#rpm -qa|grep make automake-1.11.1-4.el6.noarch make-3.81-20.el6.x86_64
如果没有安装make工具
yum -y install gcc automake autoconf libtool make
查看是否安装zlib库
~#rpm -qa|grep zlib zlib-devel-1.2.3-29.el6.x86_64 zlib-1.2.3-29.el6.x86_64
安装zlib
yum install zlib-devel
检查是否安装ssl 库
~#rpm -qa|grep openssl openssl-devel-1.0.1e-16.el6_5.x86_64 openssl-static-1.0.1e-16.el6_5.x86_64 openssl098e-0.9.8e-17.el6.centos.2.x86_64 openssl-1.0.1e-16.el6_5.x86_64 openssl-perl-1.0.1e-16.el6_5.x86_64
安装openssl
yum install openssl*
安装bzip2依赖库
yum install -y bzip2*
2. 编译安装
cp Python-2.7.3.tar.bz2 /usr/src/ tar -jxvf Python-2.7.3.tar.bz2 vi Modules/Setup.dist
找到
#SSL=/usr/local/ssl #_ssl _ssl.c # -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl # -L$(SSL)/lib -lssl -lcrypto ...... #zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
把注释去掉
编译
./configure --prefix=/usr/local/python2.7 make all make install make clean make distclean
安装成功
~#/usr/local/python2.7/bin/python2.7 Python 2.7.3 (default, Dec 18 2013, 15:43:35) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >
cd /usr/local/python2.7 python setup.py install
建立python2.7 软链
~#mv /usr/bin/python /usr/bin/python.bak ~#ln -s /usr/local/python2.7/bin/python2.7 /usr/bin/python2.7 ~#ln -s /usr/bin/python2.7 /usr/bin/python
3. 解决yum无法使用的问题
~#yum update There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: No module named yum Please install a package which provides this module, or verify that the module is installed correctly. It's possible that the above module doesn't match the current version of Python, which is: 2.7.3 (default, Dec 18 2013, 15:43:35) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] If you cannot solve this problem yourself, please go to the yum faq at: http://yum.baseurl.org/wiki/Faq
因为centos 6.4 下yum默认使用的是python2.6
vi /usr/bin/yum ---------------------------------------------------- #!/usr/bin/python import sys try: import yum except ImportError: .......
修改为
#!/usr/bin/python2.6 ........
4. 安装python-pip工具
先安装setup-tools
wget https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg --no-check-certificate chmod +x setuptools-0.6c11-py2.7.egg sh setuptools-0.6c11-py2.7.egg
安装pip
wget https://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz --no-check-certificate cp pip-1.3.1.tar.gz /usr/src/ tar zxvf pip-1.3.1.tar.gz cd pip-1.3.1 python setup.py install ln -s /usr/local/python2.7/bin/pip /usr/bin/pip
神剑山庄资源网 Design By www.hcban.com
神剑山庄资源网
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
神剑山庄资源网 Design By www.hcban.com
暂无Centos 6.4 安装Python 2.7 python-pip的详细步骤的评论...
更新日志
2024年11月15日
2024年11月15日
- 黄乙玲1988-无稳定的爱心肝乱糟糟[日本东芝1M版][WAV+CUE]
- 群星《我们的歌第六季 第3期》[320K/MP3][70.68MB]
- 群星《我们的歌第六季 第3期》[FLAC/分轨][369.48MB]
- 群星《燃!沙排少女 影视原声带》[320K/MP3][175.61MB]
- 乱斗海盗瞎6胜卡组推荐一览 深暗领域乱斗海盗瞎卡组分享
- 炉石传说乱斗6胜卡组分享一览 深暗领域乱斗6胜卡组代码推荐
- 炉石传说乱斗本周卡组合集 乱斗模式卡组最新推荐
- 佟妍.2015-七窍玲珑心【万马旦】【WAV+CUE】
- 叶振棠陈晓慧.1986-龙的心·俘虏你(2006复黑限量版)【永恒】【WAV+CUE】
- 陈慧琳.1998-爱我不爱(国)【福茂】【WAV+CUE】
- 咪咕快游豪礼放送,百元京东卡、海量欢乐豆就在咪咕咪粉节!
- 双11百吋大屏焕新“热”,海信AI画质电视成最大赢家
- 海信电视E8N Ultra:真正的百吋,不止是大!
- 曾庆瑜1990-曾庆瑜历年精选[派森][WAV+CUE]
- 叶玉卿1999-深情之选[飞图][WAV+CUE]