python - 无法使用 pip 安装软件包(SSL:CERTIFICATE_VERIFY_FAILED)
问题描述
我一直无法下载任何软件包,pip
并且我不断收到关于确认 SSL 证书问题的相同错误。我目前在我大学的网络上,我的笔记本电脑上也安装了 Anaconda。我不确定这两个因素是否与这个问题有关。
我正在使用python
版本3.7.0
、pip
版本9.0.1
和pip3
版本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
解决方案
根据这个问题,您还应该作为受信任的主机添加pypi.python.org
到命令行,即:
pip install --trusted-host pypi.org --trusted-host pypi.python.org \
--trusted-host files.pythonhosted.org django
推荐阅读
- c# - 是否可以将 WPF 事件添加到队列中以按顺序执行?
- git - 如何从远程分支获取文件到本地分支 [Github]
- reactjs - 为什么这两段 Hello World 代码的行为不同?
- java - java.lang.ClassCastException:CustomAdapter 无法在 java 中转换为 android.widget.ArrayAdapter
- python - cv2.imwrite 返回 false 而不是保存图像
- python - 将 Drive Mount 与 Google Colab 一起使用时出错
- ios - 将地图框注释添加到地图后立即可拖动
- python - 为什么打开终端时出现此错误?
- java - “命令失败,错误 168(InvalidPipelineOperator):'无法识别的表达式'$match'
- python - 替换所有连续重复的字母,忽略特定的单词