Python添加ssl模块
本文最后更新于:1 年前
又遇到一个坑,Django需要_ssl
模块,默认安装的Python没有,重新编译一下,教程很多,我简单记录一下。
进入Python的源码目录
cd Python-3.7.2/Modules
vim Setup.dist
去掉下面几行前面的注释:
# 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
./configure
make
sudo make install
这样就完成了。
参考资料:
本博客所有文章除特别声明外,均采用 CC BY-SA 3.0协议 。转载请注明出处!