栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

【pip报错】Could not fetch URL https://pypi.org/simple/gast/:There was a problem confirming the ssl cert

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

【pip报错】Could not fetch URL https://pypi.org/simple/gast/:There was a problem confirming the ssl cert

pip install -r requirements.txt

问题1:

【报错】Could not fetch URL https://pypi.org/simple/gast/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=‘pypi.org’, port=443): Max retries exceed with url: /simple/gast/ (Caused by SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”)) - skipping

【原因】国内无法直接访问到pypi,加了豆瓣的源之后就解决了被墙的问题。

【解决方案】

pip install -r requirements.in -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

问题2

【报错】ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

【原因】pip使用更新的问题,按照它推荐的来。

【解决方案】

pip install -r requirements.in -i http://pypi.douban.com/simple --trusted-host pypi.douban.com --use-feature=2020-resolver

问题3

【报错】Requirement already satisfied: xxx in c:anaconda3libsite-packages
【原因】最初我以为是包都下载好了,后来发现Settings里边解释器里并没有相关依赖,而且requirement.txt的文件里的还是标黄的。这才发现系统里有的,和现在项目所处的虚拟环境不一样。
【解决方案】
【错误方案】我找到报错提示的目录下,把这里所有包都复制到python解释器所在目录下的/lib/site-packeges里。
【正确方案】

pip install -r requirments --target=

问题4

因为问题3错误解决方案的不严谨,致使出现了新的问题:
【报错】ImportError: cannot import name ‘InvalidSchemeCombination’
from pip._internal.exceptions import InvalidSchemeCombination, UserInstallationInvalid
【原因】在直接复制到目标目录下时,有一些文件收到了影响使其损坏,其中就有pip。
【解决方案】
1.先找到目标目录【项目使用的python解释器所在目录下的/lib/site-packeges】,找到pip相关文件夹全部删除。
2.强行删除pip

conda remove --force pip

3.下载pip

conda install -c anaconda pip

【最终使用pip下载不报错的命令行】

pip install -r requirements.txt -i http://pypi.douban.com/simple --trusted-host pypi.douban.com --use-feature=2020-resolver --target=D:ProgramDataAnaconda3envstensorflowLibsite-packages

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/920373.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号