[英]pip3.4 issue with SSL certificate but NOT pip
我正在尝试在MacOs X中使用pip为python3.4安装库。系统还提供了python2.7本机版本。 所以,这很好
> pip install numpy
Requirement already satisfied (use --upgrade to upgrade): numpy in
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Cleaning up...
但是当我尝试为python3.4安装时
pip3.4 install numpy
我懂了
Downloading/unpacking numpy
Could not fetch URL https://pypi.python.org/simple/numpy/: There was a
problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed (_ssl.c:598)
Will skip URL https://pypi.python.org/simple/numpy/ when looking for
download links for numpy
Could not fetch URL https://pypi.python.org/simple/: There was a
problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed (_ssl.c:598)
Will skip URL https://pypi.python.org/simple/ when looking for download
links for numpy
Cannot fetch index base URL https://pypi.python.org/simple/
Could not fetch URL https://pypi.python.org/simple/numpy/: There was a
problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed (_ssl.c:598)
Will skip URL https://pypi.python.org/simple/numpy/ when looking for
download links for numpy
Could not find any downloads that satisfy the requirement numpy
Cleaning up...
No distributions at all found for numpy
我读过pip 1.5版存在问题。 尤其是
> pip --version
pip 1.2.1 from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg (python 2.7)
而
> pip3.4 --version
pip 1.5 from /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pip-1.5-py3.4.egg (python 3.4)
这是我的问题吗? 我该如何解决?
如果证书无效,理想情况下,您应该导入系统并将其标记为受信任(如果您确实信任),并通过以下方式指定:
pip --cert file.pem install numpy
或使用--trusted-host
参数,例如:
pip --trusted-host https://pypi.python.org/simple/numpy/ install numpy
将该主机标记为受信任的主机,即使它没有有效的证书也是如此。
另请参阅: SSL证书验证 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.