我将PyPi包上传到Artifactory本地存储库。 当我运行
pip install -v package==0.1
它返回此错误。
Looking in indexes: https://artifactory/api/pypi/pypi/simple
Collecting toolboxio==0.1
1 location(s) to search for versions of toolboxio:
* https://artifactory/api/pypi/pypi/simple/package/
Getting page https://artifactory/api/pypi/pypi/simple/package/
Looking up "https://artifactory/api/pypi/pypi/simple/package/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): artifactory:443
https://artifactory:443 "GET /api/pypi/pypi/simple/package/ HTTP/1.1" 404 None
Status code 404 not in (200, 203, 300, 301)
Could not fetch URL https://artifactory/api/pypi/pypi/simple/package/: 404 Client Error: Not Found for url: https://artifactory/api/pypi/pypi/simple/package/ - skipping
ERROR: Could not find a version that satisfies the requirement package==0.1 (from versions: none)
Cleaning up...
将pypi存储库配置为在安装过程中使用简单默认布局,
[orgPath]/[module]/[module]-[baseRev].[ext]
工件以这种格式上传到PyPi本地存储库
pypi-local -
company/package -
package-0.1.tar.gz
当我访问
"https://artifactory/api/pypi/pypi/simple/package/"
在浏览器中,我可以找到工件。
当我使用
curl -X GET "https://artifactory/api/pypi/pypi/simple/package/"
返回
"errors" : [ {
"status" : 404,
"message" : "Not Found"
} ]
我在pip.conf中使用Artifactory Set Me进行设置
[global]
index-url = https://artifactory/api/pypi/pypi-local/simple
Artifactory版本:Artifactory Pro 6.8.1
我无法进行pip安装。有任何想法吗 ?
谢谢。
答案 0 :(得分:0)
我设法找到了解决方案,我想分享我所做的事情。
Artifactory通过Set Me Up功能生成了pip.conf
[global]
index-url = https://artifactory/api/pypi/pypi-local/simple
显然,要访问本地上传的文件,您需要将凭据传递到index-url。
如何生成凭据以传递到索引URL。
1)进入Artifactory。
2)单击编辑配置文件。生成API密钥。复制API密钥。
3)编辑pip.conf文件。
[global]
index-url = https://username:<API-KEY>/api/pypi/pypi-local/simple
4)重新运行pip安装。现在应该可以使用了。