当前位置:   article > 正文

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

pip is configure with location

解决错误: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
  • 1

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

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

升级pip:

pip38 install --upgrade pip
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小惠珠哦/article/detail/793778
推荐阅读
相关标签
  

闽ICP备14008679号