首页 > 解决方案 > 在 python 3.7 中确认 ssl 模块,ssl 模块不可用

问题描述

我尝试了许多针对不同版本发布的东西,但无法克服这个问题。脚本位置有什么要替换的吗?或添加任何代码?

C:\Users\HARSHA>pip install speechrecognition
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting speechrecognition
  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 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 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.
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

这是我得到的错误

标签: python-3.xpipssl-certificate

解决方案


我相信这是同样的错误。

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

解决方案是:

“我可以通过在系统环境中添加具有 libeay32.dll(在我的情况下为 C:\Users\Gabriel\Anaconda3\pkgs\openssl-1.1.1a-he774522_0\Library\bin)作为最高位置的 python 的 dir 路径来解决这个问题。”

https://stackoverflow.com/a/54531318/2747958


推荐阅读