无法使用pip安装软件包(SSL:CERTIFICATE_VERIFY_FAILED)

时间:2018-10-04 01:44:44

标签: python django python-3.x pip

我无法使用pip下载任何软件包,并且由于确认SSL证书的问题,我一直收到相同的错误消息。我目前在大学的网络上,并且笔记本电脑上还安装了Anaconda。我不确定这两个因素是否与此问题有关。

我正在使用python版的3.7.0pip版的9.0.1pip3版的10.0.1

当我在终端中输入pip install django时,我得到以下结果:

Collecting django
  Could not fetch URL https://pypi.python.org/simple/django/:
     There was a problem confirming the ssl certificate: 
     [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)
     - skipping
  Could not find a version that satisfies the requirement django (from versions: )
No matching distribution found for django

我已经阅读了其他几个主题。我已经尝试过诸如此类的命令,但没有成功:

curl https://bootstrap.pypa.io/get-pip.py | python3
pip install --upgrade pip
pip install --trusted-host pypi.org --trusted-host \
  files.pythonhosted.org django

3 个答案:

答案 0 :(得分:2)

根据this issue,您还应该将pypi.python.org作为受信任的主机添加到命令行,即:

pip install --trusted-host pypi.org --trusted-host pypi.python.org \
            --trusted-host files.pythonhosted.org django

答案 1 :(得分:0)

我遇到了类似的问题,对我来说,解决方案是通过向环境变量添加三个路径

C:\Anaconda3; 

C:\Anaconda3\Scripts; 

C:\Anaconda3\Library\bin;

我一直在窗口7上使用python 3.7.1和anaconda 4.8.2。您可以检查缺少的路径环境变量,并仅添加缺少的环境变量。

答案 2 :(得分:-1)

打开Anaconda提示符并运行以下命令:

conda install -f pip

pip install pandas