问题1:pip install -r requirements.txt
【报错】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,加了豆瓣的源之后就解决了被墙的问题。
【解决方案】
问题2pip install -r requirements.in -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
【报错】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使用更新的问题,按照它推荐的来。
【解决方案】
问题3pip install -r requirements.in -i http://pypi.douban.com/simple --trusted-host pypi.douban.com --use-feature=2020-resolver
【报错】Requirement already satisfied: xxx in c:anaconda3libsite-packages
【原因】最初我以为是包都下载好了,后来发现Settings里边解释器里并没有相关依赖,而且requirement.txt的文件里的还是标黄的。这才发现系统里有的,和现在项目所处的虚拟环境不一样。
【解决方案】
【错误方案】我找到报错提示的目录下,把这里所有包都复制到python解释器所在目录下的/lib/site-packeges里。
【正确方案】
问题4pip install -r requirments --target=
因为问题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
【最终使用pip下载不报错的命令行】conda install -c anaconda 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



