pip install:ssl证书问题

时间:2023-01-05 00:20:13

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:

我正在使用Debian 9,我已经安装了Python 3.6.2和pip 9.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配置了需要TLS / SSL的位置,但Python中的ssl模块不可用。收集numpy无法获取URL https://pypi.python.org/simple/numpy/:确认ssl证书时出现问题:无法连接到HTTPS URL,因为SSL模块不可用。 - 跳过无法找到满足要求numpy的版本(来自版本:)没有找到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.

我尝试了这个主题的最佳答案(pip安装失败,出现“连接错误:[SSL:CERTIFICATE_VERIFY_FAILED]证书验证失败(_ssl.c:598)”)但它没有用。实际上,我得到了相同的错误消息。

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

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

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

2 个解决方案

#1


6  

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

    在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

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

  2. Make sure libssl-dev is installed

    确保已安装libssl-dev

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

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

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

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

Hope that helped someone. :D

希望有人帮助过。 :d

#2


1  

I ran the following commands to resolve the issue

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

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

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

#1


6  

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

    在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

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

  2. Make sure libssl-dev is installed

    确保已安装libssl-dev

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

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

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

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

Hope that helped someone. :D

希望有人帮助过。 :d

#2


1  

I ran the following commands to resolve the issue

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

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

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