321.【python】_ssl 模块支持

321.【python】_ssl 模块支持,第1张

记录一下搭建环境是遇到的 python 里出现的 缺少 _ssl 模块的问题。

当我们直接配置的时候,会缺少 _ssl ,所以我们在使用 configure 配置前,先编辑 ${python_install_dirctory}/Module/Setup 文件,如下所示:

将第210、215、216、217 行的注释去了,去了之后,再执行配置安装即可。

Linux 的学习是使用基本上都得面临枯燥的黑窗口,慢慢来吧。

首先需要确定已经安装了openssl和openssl-devel,然后在编译python源码前打开SSL支持:

$ sudo vi Modules/Setup.dist

# Socket module helper for SSL supportyou 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</pre>

然后再执行configure,make,make install命令。

最后要确定当前默认的python是刚安装的2.5而不是原来的2.4。


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/bake/11421182.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-16
下一篇2023-05-16

发表评论

登录后才能评论

评论列表(0条)

    保存