gpt4 book ai didi

python - SSL 证书的 pip3.4 问题但不是 pip

转载 作者:太空宇宙 更新时间:2023-11-03 13:07:21 26 4
gpt4 key购买 nike

我正在尝试在我的 MacOs X 中使用 pip 安装 python3.4 的库。还有系统自带的 python2.7 native 版本。所以,这很好用

> 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 Cert Verification .

关于python - SSL 证书的 pip3.4 问题但不是 pip,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33138111/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com