首页 > 解决方案 > 在 PyCharm 中安装包的问题

问题描述

我在 PyCharm 中安装包时遇到问题。我尝试安装 SpeechRecognition 和其他软件包,但我总是得到这样的结果:

Collecting SpeechRecognition
Could not fetch URL https://pypi.org/simple/speechrecognition/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/speechrecognition/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
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

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
  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/speechrecognition/
  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/speechrecognition/
  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/speechrecognition/
  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/speechrecognition/
  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/speechrecognition/
  Could not find a version that satisfies the requirement SpeechRecognition (from versions: )
No matching distribution found for SpeechRecognition
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

我能做些什么?

标签: pythonpycharm

解决方案


对于 Windows 10,如果您想在普通 cmd 中使用 pip,而不仅仅是在 Anaconda 提示符下。您需要添加 3 个环境路径。像这样:D:\Anaconda3; D:\Anaconda3\脚本;D:\Anaconda3\库\bin

大多数人只添加 D:\Anaconda3\Scripts;

pip 窃取的配置了需要 TLS/SSL 的位置,但是 Python 中的 ssl 模块不可用


推荐阅读