1、下载Python2.7
http://www./ftp/python/2.7/Python-2.7.tar.bz2
2、解压缩到当前目录
tar jxvf Python-2.7.tar.bz2
3、编辑Modules/Setup.dist
找到SSL和zlib模块,去掉某些注释,结果如下:
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
SSL=/usr/local/ssl
ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
# Andrew Kuchling's zlib module.
# This require zlib 1.1.3 (or later).
# See http://www./zlib/
zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
4、安装OpenSSL
apt-get install libssl-dev
5、编译安装Python2.7
./configure
make && make install
|