下载python源码包:
https://www.python.org/downloads/release/python-2712/
下载setuptool包:
https://pypi.python.org/pypi/setuptools#code-of-conduct
下载pip包:
http://pypi.python.org/packages/source/p/pip/pip-1.0.tar.gz
python官网上说2.7.9之后pip就在默认的包里,反正我发现2.7.12是没有的。不过py3里还是有的
安装相关依赖以及python:
$ yum groupinstall -y 'development tools'
$ yum install -y zlib-devel bzip2-devel openssl-devel xz-libs
$ wget https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tar.xz
$ xz -d Python-2.7.8.tar.xz
$ tar -xvf Python-2.7.8.tar
$ cd Python-2.7.12;./configure --prefix=/usr/local/python27
$ make && make install
$ /usr/local/python27/bin/python -V
安装setup(需要zlib相关的包):
$ wget --no-check-certificate https://pypi.python.org/packages/1f/7a/6b239a65d452b04ad8068193ae313b386e6fc745b92cd4584fccebecebf0/setuptools-25.1.6.tar.gz
# Extract the files:
$ tar -xvf setuptools-25.1.6.tar.gz
cd setuptools-25.1.6
# Install setuptools using the Python 2.7.12:
$ python2.7 setup.py install
安装pip:
$ gunzip pip-1.0.tar.gz
$ python2.7 setup install
所有相关的东西都在/usr/local/python27/bin下面