无法使用 pip 安装:SSL 错误

无法使用 pip 安装:SSL 错误

我是编程新手,最近才开始学习 Python。每当我输入pip install django(例如)时,我都会收到以下错误消息:

WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)'))':/simple/django/

Could not fetch URL https://pypi.org/simple/django/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/django/ (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)'))) - skipping

ERROR: Could not find a version that satisfies the requirement django

ERROR: No matching distribution found for django

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(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)'))) - skipping

无论我安装什么,我都会收到相同的消息。我尝试过类似的变体命令python -m pip install django==3.1.7,但都没有成功。我直接从网站安装了 Python,并且正在使用 PyCharm。我真的无法取得进展,所以非常感谢您的帮助!

相关内容