linux Pip无法找到满足需求的版本,但它在我的私有PyPI存储库中

bakd9h0s  于 2023-05-16  发布在  Linux
关注(0)|答案(1)|浏览(130)

我知道很多问题都被问到了,但我被难住了。
我有一个私有的PyPI仓库,比如“https://pypi.my_domain.com”,它已经运行了几年。然而,当我运行下面的命令时(以前是有效的),它说它找不到文件,但我看到它就在那里!

$ ./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

以下是我的私有PyPI repo中可供下载的文件:

当我运行pip debug --verbose查看兼容版本时,我得到以下输出,它与我在私人存储库中可供下载/安装的内容相匹配。注意最后一个cp36-cp36m-linux_armv7l,这是我在这台类似乌藨子Pi的计算机上需要的。
注意:这已经工作过很多次了!今天它就不工作了…

/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
  ...
ilmyapht

ilmyapht1#

这个解决方案很愚蠢。我的USERNAMEPASSWORD环境变量为空/空,因为我在当天早些时候复制了另一个.env文件后,它们不在.env文件中...
使用-vvv详细安装pip install -vvv --index-url https://${USERNAME}:${PASSWORD}@pypi.my_domain.com canpy显示了错误。提示是“403”错误……

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'

相关问题