Python中pip安装模块报找不到ssl模块错误

首页 > 技术

Python中pip安装模块报找不到ssl模块错误

来源:匿名 发布时间:2021-11-26 08:27

Python 中用 pip 安装模块时报如下错误:

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available


原因:编译 Python 时 ssl 模块未编译


解决办法:

1、安装 openssl

./config --prefix=/root/openssl --openssldir=/root/openssl no-ssl2

make

make install

2、编译Python

./configure --with-openssl=/root/openssl

make

make install

最后执行 python -m ssl,如果没有任何内容输出的话,说明 ssl 模块编译成功,问题解决。

上一篇:安阳狗咬人事... 下一篇:安阳狗咬人事...
猜你喜欢
热门阅读
同类推荐