Lin Hong's TECH Blog! 刀不磨要生锈,人不学习要落后 - Thinking ahead

Python2.7 Linux安装

2016-02-21

TPC

Linux上安装的是Python2.6,下载更新为Python2.7

Python2.7 Linux安装

1.下载安装

mkdir -p /usr/local/python && cd /usr/local/python && wget https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz && tar zxvf Python-2.7.8.tgz && cd Python-2.7.8 && ./configure –prefix=/usr/local/python && make && make install

2.软连接的创建

mv /usr/bin/python /usr/bin/python_bak && ln -s /usr/local/python/bin/python2.7 /usr/bin/python

3.setuptools

安装链接,如:

$wget –no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-12.0.3.tar.gz#md5=f07e4b0f4c1c9368fcd980d888b29a65

安装
$ tar -zxvf setuptools-12.0.3.tar.gz

$ cd setuptools=12.0.3

$ python setup.py install

4.之前版本easy_install的软连接

mv /usr/bin/easy_install /usr/bin/easy_install_back

ln -s /usr/local/python/bin/easy_install /usr/bin/easy_install


Comments