我正在使用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证书问题
发布评论