【发布时间】: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 请看我更新的问题,在我的版本之后也出现了同样的问题。
-
您是否需要与您的工作场所讨论防火墙...