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 模組編譯成功,問題解決。

上一篇:安陽狗咬人事... 下一篇:安陽狗咬人事...
猜你喜歡
熱門閱讀
同類推薦