pip安装:ssl证书问题

编程入门 行业动态 更新时间:2024-10-09 20:25:05
本文介绍了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无法获取 网址 pypi.python/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 pypi.python/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安装失败,并显示连接错误:[SSL:CERTIFICATE_VERIFY_FAILED]证书验证失败(_ssl.c:598)" ),但此操作无效.实际上,我得到了相同的错误消息.

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 = pypi.python/simple/numpy --trusted-host pypi.python numpy

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

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

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

推荐答案

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

  • 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 packageName

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

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

    Hope that helped someone. :D

  • 更多推荐

    pip安装:ssl证书问题

    本文发布于:2023-06-05 23:14:41,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/529897.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:证书   pip   ssl

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!