解决错误:pip is configured with locations that require TLS/SSL,the ssl module in Python is not available

04-08 1547阅读

解决错误:pip is configured with locations that require TLS/SSL,the ssl module in Python is not available。

解决错误:pip is configured with locations that require TLS/SSL,the ssl module in Python is not available
(图片来源网络,侵删)

pip安装包出现错误类似如下:

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

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple

Collecting protobuf>=4.25.2 (from -r requirements.txt (line 3))

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”)’: /simple/protobuf/

WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”)’: /simple/protobuf/

WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”)’: /simple/protobuf/

WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”)’: /simple/protobuf/

WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”)’: /simple/protobuf/

Could not fetch URL https://pypi.tuna.tsinghua.edu.cn/simple/protobuf/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=‘pypi.tuna.tsinghua.edu.cn’, port=443): Max retries exceeded with url: /simple/protobuf/ (Caused by SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”)) - skipping

ERROR: Could not find a version that satisfies the requirement protobuf>=4.25.2 (from -r requirements.txt (line 3)) (from versions: none)

ERROR: No matching distribution found for protobuf>=4.25.2 (from -r requirements.txt (line 3))

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

Could not fetch URL https://pypi.tuna.tsinghua.edu.cn/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=‘pypi.tuna.tsinghua.edu.cn’, 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

或者如下错误:

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

Collecting protobuf>=4.25.2 (from -r requirements.txt (line 3))

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”)’: /simple/protobuf/

WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”)’: /simple/protobuf/

WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”)’: /simple/protobuf/

WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”)’: /simple/protobuf/

WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”)’: /simple/protobuf/

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

ERROR: Could not find a version that satisfies the requirement protobuf>=4.25.2 (from -r requirements.txt (line 3)) (from versions: none)

ERROR: No matching distribution found for protobuf>=4.25.2 (from -r requirements.txt (line 3))

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

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


解决方法:

 yum -y install openssl-devel

之后重新编译一下Python即可,不需要重新建立软连接。

或者卸载 python之后 重新安装一下。

升级pip:

pip38 install --upgrade pip
VPS购买请点击我

文章版权声明:除非注明,否则均为主机测评原创文章,转载或复制请以超链接形式并注明出处。

目录[+]