出于某种原因,我无法理解,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从我的索引和barpypi 中获取,对吗?嗯……恐怕不是这样。使用此配置,它不是foo从我的索引下载,而是foo在 pypi 中下载包。即使在安装后,如果我pip search foo再次运行,它会检测到我的为latest,但全局检测为installed为了测试的目的,为了有一个干净的基线,我尝试了python:3.7-alpine相同的结果。作为一种解决方法,我已经设置了包的版本,yzt-0.1以便我可以专门安装,foo:yzt-0.1并且由于它不会在全局中找到它,它将从我的存储库中安装。
添加回答
举报
0/150
提交
取消