我的构建机器没有互联网连接。所以我在名称为“ https://pypi.org/”的名称为“ proxy_repo”的关系中创建了代理存储库。并在构建机器中创建〜/ .pip / pip.config。
https://pypi.org/允许通过链接从构建计算机进行访问。
pip.conf的内容如下
[global]
trusted-host=MyPrivate-nexusrepo.com
index = https://MyPrivate-nexusrepo.com/content/repositories/proxy_repo/pypi
index-url = https://MyPrivate-nexusrepo.com/content/repositories/proxy_repo/simple
当我执行任何pip命令时,说出“ pip -v install django”,我总是遇到以下错误。有人可以帮忙吗?
Collecting django
1 location(s) to search for versions of django:
* https://MyPrivate-nexusrepo.com/content/repositories/proxy_repo/simple/django/
Getting page https://MyPrivate-nexusrepo.com/content/repositories/proxy_repo/simple/django/
Looking up "https://MyPrivate-nexusrepo.com/content/repositories/proxy_repo/simple/django/" in the cache
No cache entry available
Starting new HTTPS connection (1): MyPrivate-nexusrepo.com
"GET /content/repositories/proxy_repo/simple/django/ HTTP/1.1" 404 None
Could not fetch URL https://MyPrivate-nexusrepo.com/content/repositories/proxy_repo/simple/django/: 404 Client Error: Not Found for url: https://MyPrivate-nexusrepo.com/content/repositories/proxy_repo/simple/django/ - skipping
Could not find a version that satisfies the requirement django (from versions: )
Cleaning up...
No matching distribution found for django
答案 0 :(得分:0)
我以前遇到过此问题,通过设置我的日期和时间解决了我的问题。如果计算机的日期和时间不是最新的,则会阻止从Python.org提取数据
答案 1 :(得分:0)
经常使在受限环境中运行的人员绊倒的一件事是,必须允许通过企业防火墙访问这两个服务器:
https://files.pythonhosted.org/
这样做的原因是,对第一个URL的请求经常针对所请求的内容重定向到第二个URL。