我使用jfrog CLI和命令构建了PyPI包,并将其推送到我们的on-prem 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/
两者均已成功上传。
按照以下步骤从.whl文件中安装pip软件包时,可以正常工作:
- 下载https://artifacts.xyz.com/artifactory/webapp/#/artifacts/browse/tree/PyPIInfo/pypi-main-dev-local/xyz_easysdlc.traceability_matrix_generator/0.0.1.dev20200102111901+dirty.0.g251f725.mock.develop/xyz_easysdlc.traceability_matrix_generator-0.0.1.dev20200102111901+dirty.0.g251f725.mock.develop-py3-none-any.whl
- 运行
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
你们有什么猜测吗?
[更新] 当我以详细模式运行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
pip install -vvv ...
,输出是什么? - Dustin Ingramhttps://artifacts.xyz.com/artifactory/api/pypi/pypi-main-dev/simple
时,它是否列出了您的软件包? - Dustin Ingramcurl https://artifacts.xyz.com/artifactory/api/pypi/pypi-main-dev/simple/xyz-easysdlc-traceability-matrix-generator/
会得到什么结果? - Dustin Ingram