【问题标题】:.pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. (Windows 10).pip 配置了需要 TLS/SSL 的位置,但是 Python 中的 ssl 模块不可用。 (视窗 10)
【发布时间】:2019-12-28 13:16:37
【问题描述】:

我正在尝试安装 quandl 以在 Jupyter 笔记本中使用。 py -m pip install quandl

但我收到以下错误,即 Python 中的 SSL 模块不可用。

Collecting quandl
  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/quandl/
  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/quandl/
  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/quandl/
  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/quandl/
  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/quandl/
  Could not fetch URL https://pypi.org/simple/quandl/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/quandl/ (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 quandl (from versions: none)
ERROR: No matching distribution found for quandl
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```

*******************************************************************************************************
I tried using the following, but nothing worked

```py -m pip install --trusted-host=pypi.org --trusted-host=files.pythonhosted.org --user quandl```

【问题讨论】:

  • 有人对此问题有可行的答案吗?我在安装 OSGeo4W64 和安装 QGIS 3.10 ltr 时遇到了同样的问题。我有需要第三方软件包的插件,我无法安装它们。

标签: python python-3.x ssl pip quandl


【解决方案1】:

如果您使用的是 Anaconda,则在环境路径中添加以下内容:-

D:\Anaconda3; 
D:\Anaconda3\Scripts; 
D:\Anaconda3\Library\bin;

【讨论】:

  • 我在其他地方看到过这个帖子。我在“PATH”下的“系统环境变量”中添加了这个。但它不起作用。这是正确的方法吗?还是说添加到 Conda/Anaconda?
  • 编辑环境路径后需要重启终端/命令提示符。
  • 谢谢罗希特。我这样做了。仍然出现相同的错误:警告:pip 配置了需要 TLS/SSL 的位置,但是 Python 中的 ssl 模块不可用。
  • 遗憾的是,如果 Anaconda 不是安装的一部分,这不是答案。如果它是作为 QGIS 的一部分安装的呢?还是 OSGeo4W64?我对标准 Python 3.7 安装完全没有问题,但由于此错误,无法在 QGIS 解释器中安装任何东西。添加解释器路径(例如:C:\Program Files\QGIS 3.10\apps\Python37\Scripts)并不能解决问题。
【解决方案2】:

尝试在要安装 pip 的目录中重新安装 python。

然后安装 pip 就可以了。

【讨论】:

    猜你喜欢
    • 2019-06-21
    • 2021-07-27
    • 1970-01-01
    • 2021-11-04
    • 2020-10-30
    • 1970-01-01
    • 2023-01-20
    • 2021-07-28
    • 1970-01-01
    相关资源
    最近更新 更多