由于要使用TLSv1.2,而2.7.9才支持这一特性,所以需要对python进行升级。
- 源码编译python2.7.9
sudo apt install libsqlite3-dev
wget -c https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz
tar -xzvf Python-2.7.9.tgz
cd Python-2.7.9/
LDFLAGS="-L/usr/lib/x86_64-linux-gnu" ./configure --enable-loadable-sqlite-extensions
make
sudo make install
- 安装setuptools
wget https://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz --no-check-certificate
tar zxvf setuptools-0.6c11.tar.gz
cd setuptools-0.6c11/
python setup.py build
sudo python setup.py install
- 安装pip1.5.5
wget --no-check-certificate https://github.com/pypa/pip/archive/1.5.5.tar.gz
tar zxvf 1.5.5.tar.gz
cd pip-1.5.5/
python setup.py build
sudo python setup.py install
- 安装相关模块
sudo pip2.7 install six
sudo pip2.7 install pycrypto