Pip could not find a version that satisfies the requirement, but it IS there in my private PyPI repository

885 views Asked by At

I know many questions have been asked along these lines, but I'm stumped.

I've got a private PyPI repo at something like "https://pypi.my_domain.com" and it's been working well for a few years now. However, when I run the following command (which previously worked), it says it can't find the file, but I see it right there!

$ ./pip install --index-url https://${USERNAME}:${PASSWORD}@pypi.my_domain.com canpy
Looking in indexes: https://:****@pypi.my_domain.com
ERROR: Could not find a version that satisfies the requirement canpy (from versions: none)
ERROR: No matching distribution found for canpy

Here are the files available for download in my private PyPI repo: Private PyPI repo contents

When I run pip debug --verbose to see the compatible versions, I get the following output, which matches what I have available for download/install in my private repo. Note the last one cp36-cp36m-linux_armv7l which is the one I need on this Raspberry Pi-like computer.

NOTE: This has worked before, many times! Today it just stopped working...

/mnt/dataflash/miniconda3/bin/pip debug --verbose
WARNING: This command is only meant for debugging. Do not use this with automation for parsing and getting these details, since the output and options of this command may change without notice.
pip version: pip 21.3.1 from /mnt/dataflash/miniconda3/lib/python3.6/site-packages/pip (python 3.6)
sys.version: 3.6.6 | packaged by rpi | (default, Sep  6 2018, 10:56:14)
[GCC 6.3.0 20170516]
sys.executable: /mnt/dataflash/miniconda3/bin/python
sys.getdefaultencoding: utf-8
sys.getfilesystemencoding: ascii
locale.getpreferredencoding: ANSI_X3.4-1968
sys.platform: linux
sys.implementation:
  name: cpython
'cert' config value: Not specified
REQUESTS_CA_BUNDLE: None
CURL_CA_BUNDLE: None
pip._vendor.certifi.where(): /mnt/dataflash/miniconda3/lib/python3.6/site-packages/pip/_vendor/certifi/cacert.pem
pip._vendor.DEBUNDLED: False
vendored library versions:
  CacheControl==0.12.6
  colorama==0.4.4
  distlib==0.3.3
  distro==1.6.0
  html5lib==1.1
  msgpack==1.0.2 (Unable to locate actual module version, using vendor.txt specified version)
  packaging==21.0
  pep517==0.12.0
  platformdirs==2.4.0
  progress==1.6
  pyparsing==2.4.7
  requests==2.26.0
  certifi==2021.05.30
  chardet==4.0.0
  idna==3.2
  urllib3==1.26.7
  resolvelib==0.8.0
  setuptools==44.0.0 (Unable to locate actual module version, using vendor.txt specified version)
  six==1.16.0
  tenacity==8.0.1 (Unable to locate actual module version, using vendor.txt specified version)
  tomli==1.0.3
  webencodings==0.5.1 (Unable to locate actual module version, using vendor.txt specified version)
Compatible tags: 174
  cp36-cp36m-manylinux_2_25_armv7l
  cp36-cp36m-manylinux_2_24_armv7l
  cp36-cp36m-manylinux_2_23_armv7l
  cp36-cp36m-manylinux_2_22_armv7l
  cp36-cp36m-manylinux_2_21_armv7l
  cp36-cp36m-manylinux_2_20_armv7l
  cp36-cp36m-manylinux_2_19_armv7l
  cp36-cp36m-manylinux_2_18_armv7l
  cp36-cp36m-manylinux_2_17_armv7l
  cp36-cp36m-manylinux2014_armv7l
  cp36-cp36m-linux_armv7l
  ...
1

There are 1 answers

2
Sean McCarthy On BEST ANSWER

The solution was silly. My USERNAME and PASSWORD environment variables were blank/empty because they weren't in the .env file after I copied over another .env file earlier in the day...

Installing with -vvv verbosity with pip install -vvv --index-url https://${USERNAME}:${PASSWORD}@pypi.my_domain.com canpy showed me the error. The hint was the "403" error...

Using pip 21.3.1 from /mnt/dataflash/miniconda3/lib/python3.6/site-packages/pip (python 3.6)
Non-user install because site-packages writeable
Created temporary directory: /tmp/pip-ephem-wheel-cache-j365kda5
Created temporary directory: /tmp/pip-req-tracker-j6so4a2n
Initialized build tracking at /tmp/pip-req-tracker-j6so4a2n
Created build tracker: /tmp/pip-req-tracker-j6so4a2n
Entered build tracker: /tmp/pip-req-tracker-j6so4a2n
Created temporary directory: /tmp/pip-install-w8codrsc
Looking in indexes: https://:****@pypi.my_domain.com
1 location(s) to search for versions of canpy:
* https://:****@pypi.my_domain.com/canpy/
Fetching project page and analyzing links: https://:****@pypi.my_domain.com/canpy/
Getting page https://:****@pypi.my_domain.com/canpy/
Found credentials in url for pypi.my_domain.com
Looking up "https://pypi.my_domain.com/canpy/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): pypi.my_domain.com:443
https://pypi.my_domain.com:443 "GET /canpy/ HTTP/1.1" 303 0
Status code 303 not in (200, 203, 300, 301)
Looking up "https://pypi.my_domain.com/simple/canpy/" in the cache
Request header has "max_age" as 0, cache bypassed
https://pypi.myijack.com:443 "GET /simple/canpy/ HTTP/1.1" 403 716
Status code 403 not in (200, 203, 300, 301)
Could not fetch URL https://:****@pypi.my_domain.com/canpy/: 403 Client Error: Forbidden for url: https://pypi.my_domain.com/simple/canpy/ - skipping
Skipping link: not a file: https://:****@pypi.my_domain.com/canpy/
Given no hashes to check 0 links for project 'canpy': discarding no candidates
ERROR: Could not find a version that satisfies the requirement canpy (from versions: none)
ERROR: No matching distribution found for canpy
Exception information:
Traceback (most recent call last):
  File "/mnt/dataflash/miniconda3/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 349, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
  File "/mnt/dataflash/miniconda3/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 174, in _add_to_criteria
    raise RequirementsConflicted(criterion)
pip._vendor.resolvelib.resolvers.RequirementsConflicted: Requirements conflict: SpecifierRequirement('canpy')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/mnt/dataflash/miniconda3/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 93, in resolve
    collected.requirements, max_rounds=try_to_avoid_resolution_too_deep
  File "/mnt/dataflash/miniconda3/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 482, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/mnt/dataflash/miniconda3/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 351, in resolve
    raise ResolutionImpossible(e.criterion.information)
pip._vendor.resolvelib.resolvers.ResolutionImpossible: [RequirementInformation(requirement=SpecifierRequirement('canpy'), parent=None)]

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/mnt/dataflash/miniconda3/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 164, in exc_logging_wrapper
    status = run_func(*args)
  File "/mnt/dataflash/miniconda3/lib/python3.6/site-packages/pip/_internal/cli/req_command.py", line 205, in wrapper
    return func(self, options, args)
  File "/mnt/dataflash/miniconda3/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 339, in run
    reqs, check_supported_wheels=not options.target_dir
  File "/mnt/dataflash/miniconda3/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 101, in resolve
    raise error from e
pip._internal.exceptions.DistributionNotFound: No matching distribution found for canpy
Removed build tracker: '/tmp/pip-req-tracker-j6so4a2n'