在PyCharm中安装软件包的问题

时间:2019-05-09 15:36:53

标签: python 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.

我该怎么办?

2 个答案:

答案 0 :(得分:0)

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

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

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available被盗

答案 1 :(得分:0)

我遇到了类似的问题(我在Mac环境中)。 通过更新openssl,它解决了问题!

brew upgrade openssl 

它也将我必须拥有的python版本更新为3.8,因为依赖关系使我不得不在Pycharm中重新创建解释器,以确保其正常工作。