1.安装最主要的—python3.6
方法见我的上一篇blog—python3.6安装
2.安装必要的组件—openssl and libssl-dev
apt-get install openssl
apt-get libssl-dev
3.打开python安装路径
cd /opt/python3.6.2
4. 修改文件—Setup
gedit Modules/Setup
#修改结果如下:
# Socket module helper for socket(2)
_socket socketmodule.c timemodule.c
# 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