完整教程:Python pip instsll报错 Can‘t connect to HTTPS URL because the SSL module is not available.

问题描述:

ERROR: Could not find a version that satisfies the requirement transformers (from versions: none)
ERROR: No matching distribution found for transformers

Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

解决方案:

安装openssl

sudo apt-get install openssl
sudo apt-get install libssl-dev
openssl version
OpenSSL 1.1.1  11 Sep 2018

重新安装Python版本后接可以正常使用了。

python软链接也要删除后重新引用。

pip install -r requirements.txt
pip3 install --upgrade pip

posted on 2025-11-24 00:37  ljbguanli  阅读(0)  评论(0)    收藏  举报