首页 > 解决方案 > 在命令提示符下安装软件包时出现 pip 错误

问题描述

嗨,我已经安装了 Anaconda/jupyter 笔记本,但出现错误

在此处输入图像描述

这是出现的文字

C:\Users\DELL>pip install pygame
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
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/pygame/
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/pygame/
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/pygame/
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/pygame/
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/pygame/
Could not fetch URL https://pypi.org/simple/pygame/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pygame/ 
    (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 pygame (from versions: none)
ERROR: No matching distribution found for pygame
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

标签: pythonpippygame

解决方案


我和你面临同样的问题。我尝试了很多东西,只有一个有效。该问题可能是由Windows\System32文件夹中的 DLL 档案(例如 libcrypto-1_1-x64.dll 、 libssl-1_1-x64.dll 或其他)引起的。

解决方案是从https://slproweb.com/products/Win32OpenSSL.html安装 openSSL ,将 DLL 替换为升级版本。

希望它的工作!


推荐阅读