出于某种原因,我无法理解,pip 是从全局的 pypi 而不是我自己的服务器获取包。我的包,我们称之为foo
,有一个依赖项bar
。
pip search --index-url https://example.com/simple foo
返回我的包裹。
pip install --index-url https://example.com/simple foo
导致错误,因为它无法下载bar
.
Could not find a version that satisfies the requirement bar (from foo) (from versions: ) No matching distribution found for bar (from foo)
pip install --index-url https://example.com/simple --extra-index-url https://pypi.python.org/simple foo
好的,现在问题应该解决了吧?它将foo
从我的索引和bar
pypi 中获取,对吗?嗯……恐怕不是这样。使用此配置,它不是foo
从我的索引下载,而是foo
在 pypi 中下载包。即使在安装后,如果我pip search foo
再次运行,它会检测到我的为latest
,但全局检测为installed
为了测试的目的,为了有一个干净的基线,我尝试了python:3.7-alpine
相同的结果。
作为一种解决方法,我已经设置了包的版本,yzt-0.1
以便我可以专门安装,foo:yzt-0.1
并且由于它不会在全局中找到它,它将从我的存储库中安装。
相关分类