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

Centos 7 python升级(2.7.5-》2.7.11)

时间:2016-08-20 13:20:50      阅读:1015      评论:0      收藏:0      [点我收藏+]

标签:

1.安装升级GCC

yum install gcc* openssl openssl-devel ncurses-devel.x86_64  bzip2-devel sqlite-devel python-devel zlib

2.下载python安装包

wget https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tar.xz

3.解压

xz -d Python-2.7.11.tar.xz
tar -xvf Python-2.7.11.tar
4.编译安装
cd Python-2.7.11
./configure --prefix=/usr/local
make && make install
5.将老版本python更换
mv /usr/bin/python /usr/bin/python2.7.5
6.更换默认python
export PATH="/usr/local/bin:$PATH"
或者
ln -s /usr/local/bin/python2.7  /usr/bin/python
7.下载setuptools
wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-1.4.2.tar.gz
8.安装setuptools
tar -xvf setuptools-1.4.2.tar.gz
cd setuptools-1.4.2
python setup.py install
9.下载安装pip

 wget "https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz#md5=834b2904f92d46aaa333267fb1c922bb" --no-check-certificatepip 安装命令为:

 tar -xzvf pip-1.5.4.tar.gz
 cd pip-1.5.4
 python setup.py install

pip install --upgrade pip升级

 
10.#修改 yum中的python 将#!/usr/bin/python改为 #!/usr/bin/python2.7.5
vim /usr/bin/yum
 

Centos 7 python升级(2.7.5-》2.7.11)

标签:

原文地址:http://www.cnblogs.com/akcjm/p/5790202.html

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