无法从 https://packagecloud.io/ 安装我的自定义 pip 包
Unable to install my custom pip package from https://packagecloud.io/
我使用 python 创建了我的包。我正在尝试通过 https://packagecloud.io/. So I build pip package and updated in https://packagecloud.io/
分发包
但是当我尝试在 Ubutbu 18.04 中安装相同的包时出现错误。
root@1522cdc94a23:/# pip3 install mycli==0.0.1a0
Collecting mycli==0.0.1a0
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python3/dist-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python3/dist-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python3/dist-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/usr/lib/python3/dist-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python3/dist-packages/pip/index.py", line 795, in get_page
resp.raise_for_status()
File "/usr/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/models.py", line 935, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://pypi.org/simple/mycli/
已验证 ~/.pip/pip.conf 中的 extra-index-url 参数。它具有 packagecloud.in url
根据建议添加了 --index-url。
是的。它的工作。但是另一个默认示例包(来自 packagecloud.io)在没有 --index-url
的情况下按预期工作
~$ cat ~/.pip/pip.conf
[global]
extra-index-url=https://<token>:@packagecloud.io/sivak/MyTest/pypi/simple
packagecloud_test-0.9.7b1.tar.gz是packagecloud.io提供的测试包,用于测试。
默认情况下,pip 在 pypi.org 上搜索包。
只需告诉 pip 在另一个存储库中搜索:
pip install --index-url https://packagecloud.io/ mycli==0.0.1a0
尝试这可能会确认您的 pip.conf
文件中的 pip 配置问题。
您确定您要求的版本存在于所需的遥控器上吗?
似乎下面错误信息中的可用版本没有提到版本 0.0.1a0
:
ERROR: Could not find a version that satisfies the requirement mycli==0.0.1a0 (from versions: 1.0.0, 1.0.1, 1.1.1, 1.2.0, 1.3.0, 1.4.0, 1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.7.0.0, 1.7.1, 1.8.0, 1.8.1, 1.9.0, 1.10.0, 1.11.0, 1.12.0, 1.12.1, 1.13.0, 1.13.1, 1.14.0, 1.15.0, 1.16.0, 1.17.0, 1.18.0, 1.18.1, 1.18.2, 1.19.0, 1.20.0, 1.20.1)
ERROR: No matching distribution found for mycli==0.0.1a0
只需删除安装命令的修订要求:
pip3 install mycli
更新pip后问题已解决。我猜 pip 版本有一个错误:9.0.1。
我使用 python 创建了我的包。我正在尝试通过 https://packagecloud.io/. So I build pip package and updated in https://packagecloud.io/
分发包但是当我尝试在 Ubutbu 18.04 中安装相同的包时出现错误。
root@1522cdc94a23:/# pip3 install mycli==0.0.1a0
Collecting mycli==0.0.1a0
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python3/dist-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python3/dist-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python3/dist-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/usr/lib/python3/dist-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python3/dist-packages/pip/index.py", line 795, in get_page
resp.raise_for_status()
File "/usr/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/models.py", line 935, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://pypi.org/simple/mycli/
已验证 ~/.pip/pip.conf 中的 extra-index-url 参数。它具有 packagecloud.in url
根据建议添加了 --index-url。 是的。它的工作。但是另一个默认示例包(来自 packagecloud.io)在没有 --index-url
的情况下按预期工作~$ cat ~/.pip/pip.conf
[global]
extra-index-url=https://<token>:@packagecloud.io/sivak/MyTest/pypi/simple
packagecloud_test-0.9.7b1.tar.gz是packagecloud.io提供的测试包,用于测试。
默认情况下,pip 在 pypi.org 上搜索包。
只需告诉 pip 在另一个存储库中搜索:
pip install --index-url https://packagecloud.io/ mycli==0.0.1a0
尝试这可能会确认您的 pip.conf
文件中的 pip 配置问题。
您确定您要求的版本存在于所需的遥控器上吗?
似乎下面错误信息中的可用版本没有提到版本 0.0.1a0
:
ERROR: Could not find a version that satisfies the requirement mycli==0.0.1a0 (from versions: 1.0.0, 1.0.1, 1.1.1, 1.2.0, 1.3.0, 1.4.0, 1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.7.0.0, 1.7.1, 1.8.0, 1.8.1, 1.9.0, 1.10.0, 1.11.0, 1.12.0, 1.12.1, 1.13.0, 1.13.1, 1.14.0, 1.15.0, 1.16.0, 1.17.0, 1.18.0, 1.18.1, 1.18.2, 1.19.0, 1.20.0, 1.20.1)
ERROR: No matching distribution found for mycli==0.0.1a0
只需删除安装命令的修订要求:
pip3 install mycli
更新pip后问题已解决。我猜 pip 版本有一个错误:9.0.1。