问题
安装pyhton3.8安装默认不依赖ssl
但使用requests请求https的网站报错
网上查找资料,确认是缺少ssl模块,可验证
解决
在编译安装python时候安装ssl模块
文件中 Modules/Setup去掉注释这五行
重新编译安装python
./configure --with-ssl --prefix=/usr/local/python3.8
make && make install
如果中间安装报错
/Modules/_ssl.c: In function ‘SSL_SESSION_get_ticket_lifetime_hint’:
......
make *** modules/_ssl.o error 1
上面Modules/Setup文件中注释的SSL的变量路径要对得上(或者是openssl版本过低)
当前路径 /usr/local/openssl/
验证安装
参考
https://blog.csdn.net/sinat_34149445/article/details/105387170
https://blog.csdn.net/luckydoit/article/details/104664483