【问题标题】:ssl certifcate not verified while installing numpy安装 numpy 时未验证 ssl 证书
【发布时间】:2018-07-08 07:47:55
【问题描述】:

在命令提示符下使用下面给出的命令安装 numpy 时出现问题。 试图安装metplotlib,numpy,scipy,但面临同样的问题 每次.below都是numpy安装的错误

> cd ..
> cd ..
> cd pyhton36
> cd scripts 
> pip install numpy
 collecting numpy

 Retrying (Retry(total=4, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: 
CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:841)'),)': 
/simple/numpy/
Could not fetch URL https://pypi.org/simple/numpy/: There was a problem 
confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', 
port=443): Max retries exceeded with url: /simple/numpy/ (Caused by 
SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify 
failed (_ssl.c:841)'),)) - skipping
Could not find a version that satisfies the requirement numpy (from versions: 
)
No matching distribution found for numpy
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(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify 
failed (_ssl.c:841)'),)) - skipping


so how can i correct this or can i install it in another way
I used command pip list :

package    version

pip        10.0.1

setuptools 39.0.1

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(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:841)'),)) - skipping

删除了 python3.6.6 并安装了 python3.4.4,现在命令 pip install numpy 显示错误:

找不到满足numpy要求的版本(来自版本:) 没有找到 numpy 的匹配分布

【问题讨论】:

  • 你安装了openssl吗?
  • 您在公司网络上吗?如果是这样,请联系您的网络或系统管理员并询问他们,因为他们可能会拦截您的 SSL 流量,从而导致此问题。
  • 不,我还没有安装openssl
  • 不,我使用的是专用网络
  • @NitinThakur,据我所知python 使用openssl 库进行 SSL/TLS 操作。所以你可以尝试安装openssl再检查一遍

标签: python-3.x numpy pip


【解决方案1】:

使用此命令代替“pip install numpy”。这最终对我有用。

pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org numpy

【讨论】:

    猜你喜欢
    • 2015-08-20
    • 2015-06-05
    • 2013-10-20
    • 2016-08-30
    • 2017-03-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多