0

I have created my package using python. I'm trying to distribute the package via https://packagecloud.io/. So I build pip package and updated in https://packagecloud.io/

But I'm getting an error when I try to install the same package in 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/

Verified the extra-index-url parameter in ~/.pip/pip.conf. Its having the packagecloud.in url

Added --index-url as per the suggestion. Yep. it's working. But another default sample package ( from packagecloud.io) is working as expected without --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 is the test package which is provided by packagecloud.io for testing.

Tim
  • 2,052
  • 21
  • 30
Siva Karuppiah
  • 995
  • 1
  • 8
  • 17
  • Please provide the content of your pip.conf file. – Tim Nov 25 '19 at 10:39
  • Would you please provide your pip.conf file? – Tim Nov 25 '19 at 12:24
  • Thanks! Please add it as a source code block to your question body. Also add the name of the other module working from packagecloud.io. – Tim Nov 25 '19 at 12:32
  • Are you confusing index and extra-index? Does this help? https://stackoverflow.com/questions/30889494/can-pip-conf-specify-two-index-url-at-the-same-time – Tim Nov 25 '19 at 14:03
  • pip config will be done by https://packagecloud.io/. I don't do any manual configuration. Please try trail account. – Siva Karuppiah Nov 26 '19 at 01:33

3 Answers3

1

By default, pip search for packages on pypi.org.

Just tell pip to search in another repository with:

pip install --index-url https://packagecloud.io/ mycli==0.0.1a0

Trying that may confirm a pip configuration problem in your pip.conf file.

Tim
  • 2,052
  • 21
  • 30
  • Yep. it's working. But another default sample package ( from packagecloud.io) is working as expected without --index-url . – Siva Karuppiah Nov 25 '19 at 10:42
  • Unless it is a caching side-effect, you should add this information to your original post :) Please upvote if you found this answer useful though. – Tim Nov 25 '19 at 10:47
0

Are you sure that the version you ask exists on the desired remote?

It seems that available versions in the error message below does not mention version 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

Just remove the revision requirement on install command:

pip3 install mycli
Tim
  • 2,052
  • 21
  • 30
0

The issue has been resolved when I update the pip. I guess there was a bug in pip version: 9.0.1.

Siva Karuppiah
  • 995
  • 1
  • 8
  • 17