pip安装:ssl certifi有问题

2024-05-17 20:33:31 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用的是Debian9,我已经安装了Python3.6.2和PIP9.0.1。不过,当我想安装诸如numpy、scipy或matplotlib之类的模块时,还是有问题的。当我使用pip install命令时,总是会出现以下错误:

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Collecting numpy Could not fetch URL https://pypi.python.org/simple/numpy/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping Could not find a version that satisfies the requirement numpy (from versions: ) No matching distribution found for numpy

我试过这门课的最高答案(pip install fails with "connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)"),但没有成功。事实上,我得到了同样的错误信息。

不幸的是,这个命令也失败了。

pip install --index-url=http://pypi.python.org/simple/numpy --trusted-host pypi.python.org numpy

我希望有人能解决我的问题。提前谢谢你的帮助。:天


Tags: installpiptheorg命令numpypypissl
2条回答

我运行以下命令来解决问题

$ curl https://bootstrap.pypa.io/get-pip.py >> get-pip.py $ python get-pip.py

  1. 取消对Python-3.6.2/Modules/Setup中209-212行的注释

    SSL=/usr/local/ssl _ssl _ssl.c \ -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \ -L$(SSL)/lib -lssl -lcrypto

  2. 确保已安装libssl dev

  3. 转到Python目录并执行./configure、make和make install

  4. 使用以下命令安装软件包:pip install --trusted-host pypi.python.org packageName

希望能帮上忙。:天

相关问题 更多 >