python Pip在Artifactory中找不到PyPI包

jm81lzqq  于 2023-04-28  发布在  Python
关注(0)|答案(1)|浏览(151)

我构建了PyPI包,并通过使用jfrog CLI和命令推送到我们的本地Artifactory:
tar.gz

./jfrog rt upload --url https://artifacts.XYZ.com/artifactory '--props=pypi.name=xyz_easysdlc.traceability_matrix_generator;pypi.version=0.0.1.dev20200102111901+dirty.0.g251f725.mock.develop;pypi.normalized.name=xyz-easysdlc-traceability-matrix-generator' --module=xyz_easysdlc.traceability_matrix_generator --user=**** '--password=****' dist/xyz_easysdlc.traceability_matrix_generator-0.0.1.dev20200102111901+dirty.0.g251f725.mock.develop.tar.gz pypi-main-dev/xyz_easysdlc.traceability_matrix_generator/0.0.1.dev20200102111901+dirty.0.g251f725.mock.develop/

转轮

./jfrog rt upload --url https://artifacts.xyz.com/artifactory '--props=pypi.name=xyz_easysdlc.traceability_matrix_generator;pypi.version=0.0.1.dev20200102111901+dirty.0.g251f725.mock.develop;pypi.normalized.name=xyz-easysdlc-traceability-matrix-generator' --module=xyz_easysdlc.traceability_matrix_generator --user=**** '--password=****' dist/xyz_easysdlc.traceability_matrix_generator-0.0.1.dev20200102111901+dirty.0.g251f725.mock.develop-py3-none-any.whl pypi-main-dev/xyz_easysdlc.traceability_matrix_generator/0.0.1.dev20200102111901+dirty.0.g251f725.mock.develop/

两者均成功上传。
当我从安装pip包时。whl文件,它的工作原理如下:
1.下载 www.example. com
1.运行pip install ~/Downloads/xyz_easysdlc.traceability_matrix_generator-0.0.1.dev20200102111901+dirty.0.g251f725.mock.develop-py3-none-any.whl
那么我就期望
pip install --pre --index-url https://artifacts.xyz.com/artifactory/api/pypi/pypi-main-dev/simple xyz_easysdlc.traceability_matrix_generator
我可以使用,但我得到以下错误:

ERROR: Could not find a version that satisfies the requirement xyz_easysdlc.traceability_matrix_generator (from versions: none)
ERROR: No matching distribution found for xyz_easysdlc.traceability_matrix_generator

大家猜猜看
[UPDATE]当我在verbose模式下运行pip install时,我得到以下输出:

Created temporary directory: /private/var/folders/kq/3kr8fjgx6fv272mmnglm4lph_wfb11/T/pip-ephem-wheel-cache-u7ai32js
Created temporary directory: /private/var/folders/kq/3kr8fjgx6fv272mmnglm4lph_wfb11/T/pip-req-tracker-rxb7443i
Created requirements tracker '/private/var/folders/kq/3kr8fjgx6fv272mmnglm4lph_wfb11/T/pip-req-tracker-rxb7443i'
Created temporary directory: /private/var/folders/kq/3kr8fjgx6fv272mmnglm4lph_wfb11/T/pip-install-kegd0en3
Looking in indexes: https://artifacts.xyz.com/artifactory/api/pypi/pypi-main-dev/simple
1 location(s) to search for versions of xyz-easysdlc.traceability-matrix-generator:
* https://artifacts.xyz.com/artifactory/api/pypi/pypi-main-dev/simple/xyz-easysdlc-traceability-matrix-generator/
Getting page https://artifacts.xyz.com/artifactory/api/pypi/pypi-main-dev/simple/xyz-easysdlc-traceability-matrix-generator/
Found index url https://artifacts.xyz.com/artifactory/api/pypi/pypi-main-dev/simple
Looking up "https://artifacts.xyz.com/artifactory/api/pypi/pypi-main-dev/simple/xyz-easysdlc-traceability-matrix-generator/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): artifacts.xyz.com:443
https://artifacts.xyz.com:443 "GET /artifactory/api/pypi/pypi-main-dev/simple/xyz-easysdlc-traceability-matrix-generator/ HTTP/1.1" 404 None
Status code 404 not in (200, 203, 300, 301)
Could not fetch URL https://artifacts.xyz.com/artifactory/api/pypi/pypi-main-dev/simple/xyz-easysdlc-traceability-matrix-generator/: 404 Client Error: Not Found for url: https://artifacts.xyz.com/artifactory/api/pypi/pypi-main-dev/simple/xyz-easysdlc-traceability-matrix-generator/ - skipping
Given no hashes to check 0 links for project 'xyz-easysdlc.traceability-matrix-generator': discarding no candidates
ERROR: Could not find a version that satisfies the requirement xyz_easysdlc.traceability_matrix_generator (from versions: none)
Cleaning up...
Removed build tracker '/private/var/folders/kq/3kr8fjgx6fv272mmnglm4lph_wfb11/T/pip-req-tracker-rxb7443i'
ERROR: No matching distribution found for xyz_easysdlc.traceability_matrix_generator
Exception information:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 153, in _main
    status = self.run(options, args)
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 382, in run
    resolver.resolve(requirement_set)
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 201, in resolve
    self._resolve_one(requirement_set, req)
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 365, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/legacy_resolve.py", line 311, in _get_abstract_dist_for
    req.populate_link(self.finder, upgrade_allowed, self.require_hashes)
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/req/req_install.py", line 225, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/index.py", line 906, in find_requirement
    'No matching distribution found for %s' % req
pip._internal.exceptions.DistributionNotFound: No matching distribution found for xyz_easysdlc.traceability_matrix_generator

但是当我导航到https://artifacts.xyz.com/artifactory/api/pypi/pypi-main-dev/simple/xyz-easysdlc-traceability-matrix-generator/时,我可以看到两者,*。whl和 *.tar。gz文件。只是为了确保,这不是一个“无效”的包名的问题,下面是文件的名称。

xyz_easysdlc.traceability_matrix_generator-0.0.1.dev20200102111901+dirty.0.g251f725.mock.develop-py3-none-any.whl
xyz_easysdlc.traceability_matrix_generator-0.0.1.dev20200102111901+dirty.0.g251f725.mock.develop.tar.gz
vawmfj5a

vawmfj5a1#

我找到了这个问题的根本原因。Artifactory正在发送HTTP代码404,即使你没有被授权(v。6.10.7)。当我对pip install进行身份验证时,安装成功。

相关问题