我在私有存储区(blob存储)中有一个软件包,其中有一个来自pypi存储库的install_requires
。我正在按如下方式运行pip
pip install --upgrade mypackage -i https://example.com/ --extra-index-url https://pypi.org/simple/
但失败,并显示以下错误
Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: https://pypi.org/simple/mypackage/
详细的输出是(我已经删除了几行)
Looking in indexes: https://example.com/, https://pypi.org/simple/
2 location(s) to search for versions of mypackage:
* https://example.com/mypackage/
* https://pypi.org/simple/mypackage/
Starting new HTTPS connection (1): example.com:443
https://example.com:443 "GET /mypackage/ HTTP/1.1" 304 0
Analyzing links from page https://example.com/mypackage/
Found link https://example.com/mypackage/mypackage-0.0.1-py3-none-any.whl (from https://example.com/mypackage/), version: 0.0.1
Found link https://example.com/mypackage/mypackage-0.0.1.tar.gz (from https://example.com/mypackage/), version: 0.0.1
Getting page https://pypi.org/simple/mypackage/
Looking up "https://pypi.org/simple/mypackage/" in the cache
No cache entry available
Starting new HTTPS connection (1): pypi.org:443
https://pypi.org:443 "GET /simple/mypackage/ HTTP/1.1" 404 13
Status code 404 not in [200, 203, 300, 301]
因此它找到了我的包裹,然后将其忽略。
(我是python / pip的新手,所以我可能在做一些愚蠢的事情)
我正在ubuntu 19.04上运行它 使用这些版本
(env) ubuntu@ubuntu19:~/staged/packages$ pip --version
pip 18.1 from /home/ubuntu/staged/packages/env/lib/python3.7/site-packages/pip (python 3.7)
(env) ubuntu@ubuntu19:~/staged/packages$ python3 --version
Python 3.7.3
答案 0 :(得分:0)
--extra-index-url
and --index-url
之间存在区别。第一个搜索多个URL,根据版本的不同,从错误中恢复似乎有些问题,here
解决方案将表明您的仓库是唯一使用--index-url=https://example.com/mypackage/
搜索软件包的仓库,或者在这种情况下,请尝试检查您正在执行的最新pip版本,并尝试使用pip install -U pip
进行升级。