【问题标题】:Why doesn't the public repository added work for the pip install?为什么公共存储库没有为 pip 安装添加工作?
【发布时间】:2021-09-01 23:55:56
【问题描述】:

我想安装一个库,但它说它也不可用:

> pip install tensorflow-text==2.4.1
Looking in indexes: https://pypi.douban.com/simple/
ERROR: Could not find a version that satisfies the requirement tensorflow-text==2.4.1 (from versions: 2.5.0)
ERROR: No matching distribution found for tensorflow-text==2.4.1

但是,tensorflow-text==2.4.1 明显存在于存储库中,如下所示:

https://pypi.org/project/tensorflow-text/2.4.1/

我认为原因是本地索引存储库: https://pypi.douban.com/simple/

它不使用公共 python 索引存储库。我记得有一种方法可以将 py 索引存储库更改为使用公共索引。但我忘记了如何做出改变。如何编辑使其不会查找本地索引存储库: https://pypi.douban.com/simple/

编辑:根据链接的答案,我在配置中添加了一行:

cat ~/.pip/pip.conf 
[global]
index-url=https://pypi.org/simple
extra-index-url = https://pypi.douban.com/simple/

[install]
trusted-host=pypi.douban.com

但我仍然遇到同样的问题:

pip install tensorflow-text==2.4.1
Looking in indexes: https://pypi.org/simple, https://pypi.douban.com/simple/
ERROR: Could not find a version that satisfies the requirement tensorflow-text==2.4.1 (from versions: 2.5.0)
ERROR: No matching distribution found for tensorflow-text==2.4.1

它现在在两个存储库中查找它,但仍然找不到它。这是为什么呢?

【问题讨论】:

  • 当然,如果您在工作服务器上,可能是您无权更改此设置,并且本地存储库是这样设置的,以保留对安装内容的控制。
  • @michjnich 请看我更新的问题,在我的版本之后也出现了同样的问题。
  • 您是否需要与您的工作场所讨论防火墙...

标签: python pip


【解决方案1】:

试试这个: pip install tensorflow-text 5 月 21 日发布了新版本

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-03-25
    • 2013-05-02
    • 2016-08-29
    • 1970-01-01
    • 2014-05-21
    • 2015-03-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多