[英]pip install a python package and dependencies .whl file from local pypi (JFROG artifactory) using Jenkinsfile
[英]pip cannot find package from local pypi (jfrog artifactory)
我們有一個本地 pypi,我們在其中放置了一些 python 包。 但是,pip 無法安裝該軟件包。
pip search 會找到這個包:
$ pip search --index=http://artifactory.ours.com/api/pypi/pypi-local/simple hello
hello - UNKNOWN
但是 pip install 給出了以下內容:
pip install --pre -r requirements.txt --trusted-host=artifactory.ours.com
收集 hello(來自 -r requirements.txt(第 4 行))找不到滿足要求的版本 hello(來自 -r requirements.txt(第 4 行))(來自版本:)沒有找到匹配的 hello 發行版(來自 - r requirements.txt(第 4 行))
這是requirements.txt:
# requirements.txt
--allow-all-external
--extra-index-url http://artifactory.ours.com/artifactory/api/pypi/pypi-local/simple
hello
我認為問題在於您的軟件包沒有版本號。 您的 setup.py 未指定版本。
Python 文檔中的示例(示例適用於 distutils):
所以如果我使用像1.x
這樣的舊版本的 pip ,這個問題似乎就解決了。 不確定這是 jfrog 錯誤還是與 pip 本身有關。
此問題的另一個可能原因是當您在將包上傳到 artifactory 時在包名稱中使用連字符 (-)。 pip 可以成功搜索並找到您的軟件包,但無法安裝它。 用下划線替換連字符。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.