pip安装:ssl证书问题 [英] pip install : issue with the ssl certificate

查看:243
本文介绍了pip安装:ssl证书问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Debian 9,并且已经安装了Python 3.6.2和pip 9.0.1.但是,当我想安装numpy,scipy或matplotlib等模块时仍然存在问题.使用pip install命令时,总是会出现以下错误:

I'm using Debian 9 and I have installed Python 3.6.2 and pip 9.0.1. Still, there is a problem when I want to install modules like numpy, scipy or matplotlib. I always get the following error when I use the pip install command:

pip配置了需要TLS/SSL的位置,但是ssl Python中的模块不可用.收集numpy无法获取 网址 https://pypi.python.org/simple/numpy/:问题 确认ssl证书:无法连接到HTTPS URL,因为 SSL模块不可用. -跳过找不到版本 满足numpy要求(来自版本:)无匹配项 找到numpy的发行版

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

我尝试了该主题的最高答案(),但此操作无效.实际上,我得到了相同的错误消息.

I tried the top answer of this subject (pip install fails with "connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)") but it didn't work. In fact, I get the same error message.

不幸的是,该命令也是失败的.

Unfortunately, this command was a fail as well.

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

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

我希望有人能够解决我的问题.在此先感谢您的帮助. :D

I hope someone will be able to solve my problem. Thanks in advance for your help. :D

推荐答案

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

  1. Uncomment lines 209-212 in Python-3.6.2/Modules/Setup

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

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

确保已安装libssl-dev

Make sure libssl-dev is installed

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

Go to your Python directory and do ./configure, make, and make install

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

Install packages with the following command: pip install --trusted-host pypi.python.org packageName

希望对某人有所帮助. :D

Hope that helped someone. :D

这篇关于pip安装:ssl证书问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆