【问题标题】:Unable to install python packages from remote repo无法从远程仓库安装 python 包
【发布时间】:2017-06-03 00:17:36
【问题描述】:

我正在尝试以流畅的方式从工件中下载 deendencies

requirements.txt

--index-url  https://artifactory.company.com/artifactory/api/pypi/pypi-repos
django-rss-plugin==0.0.9
nltk==3.0.1

然后运行

pip install -r requirements.txt

这会导致以下错误

Collecting django-rss-plugin==0.0.9 (from -r requirements.txt (line 3))
  Could not find a version that satisfies the requirement django-rss-plugin==0.0.9 (from -r requirements.txt (line 3)) (from versions: )
No matching distribution found for django-rss-plugin==0.0.9 (from -r requirements.txt (line 3))

对于任何依赖项都是如此。我正在为 pip 使用 9.0.1 版本。另外,https://artifactory.company.com/artifactory/api/pypi/pypi-repos 是代理远程 repo 的虚拟存储库

【问题讨论】:

    标签: python pip artifactory


    【解决方案1】:

    您可以在命令中指定索引并从文件中删除:

    pip install -r requirement.txt -i https://artifactory.company.com/artifactory/api/pypi/pypi-repos
    

    文件:

    django-rss-plugin==0.0.9
    nltk==3.0.1
    

    编辑

    错误来自索引 URL 本身。

    【讨论】:

    • 这给了我“您必须至少给出一个安装要求(请参阅“pip help install”)“
    • 哪个错误?您可以将命令和错误复制粘贴到您的问题中吗?
    • 完美!我认为您的索引网址中使用的链接不起作用。打开它返回错误,您可以验证它吗?
    • 谢谢!!!!这就是问题所在,因为我试图从远程仓库中获取它,所以我必须将它附加到 /simple
    • 我从一开始就看到了,但我说它可以这么简单 :) 对你有好处!
    猜你喜欢
    • 1970-01-01
    • 2017-07-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-14
    相关资源
    最近更新 更多