python - pip 安装 : issue with the ssl certificate

标签 python linux numpy matplotlib pip

我使用的是 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 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

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

最佳答案

  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

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

关于python - pip 安装 : issue with the ssl certificate,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46283099/

相关文章:

python - 使用编译使我的程序更快

Python 错误捕获和 FTP

python - 如果spark数据框的特定列中的所有条目为null,则删除

python - 使用 Azure Active Directory B2C 中的签名验证 ID token

linux - 在 linux 上使用 ffmpeg 删除/覆盖 mp4 视频格式上的 Logo

linux - 在将设置脚本从 CURL 传输到 BASH 时保留颜色

php - MySQL 远程访问、telnet 和 ping 无法跨具有相同顶级域的服务器工作

python - 使用 matplotlib 绘制轮廓时出错

python - 从查找表中插入数据

Python OpenCV 如何去除行与行之间的空格