0
点赞
收藏
分享

微信扫一扫

pip SSLError("Can't connect to HTTPS URL because the SSL module is not available.")

是波波呀 2024-04-11 阅读 9

pip安装mkdocs报错:

[root@postgres02 ~]# pip install mkdoc
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting mkdoc
  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/mkdoc/
  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/mkdoc/
  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/mkdoc/
  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/mkdoc/
  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/mkdoc/
  Could not fetch URL https://pypi.org/simple/mkdoc/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/mkdoc/ (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 mkdoc (from versions: none)
ERROR: No matching distribution found for mkdoc
WARNING: You are using pip version 19.2.3, however version 24.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

原因:

新版本的pip在安装软件包时用使用https

解决办法:

vim ~/.pip/pip.conf

[global]
index-url = http://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host = mirrors.aliyun.com

或者使用
http://pypi.doubanio.com/simple/


举报

相关推荐

0 条评论