从pypi安装新软件包时仅找到旧的tensorflow版本

时间:2019-12-30 23:57:20

标签: python tensorflow pip pypi

我在test.pypi上放了一个包,它确实需要tensorflow> = 1.15.0。但是,当我使用

安装它时
pip install -i https://test.pypi.org/simple/ kmeanstf==0.7.0a4

我收到消息

Looking in indexes: https://test.pypi.org/simple/
Collecting kmeanstf==0.7.0a4
Downloading https://testfiles.pythonhosted.org/packages/75/80/faf86ac10310e12015709d9763de9c0ebcf33df1f0bc884448993001ae8e/kmeanstf-0.7.0a4-py3-none-any.whl
ERROR: Could not find a version that satisfies the requirement tensorflow>=1.15.0 (from 
kmeanstf==0.7.0a4) (from versions: 0.12.1, 2.0.0a0)
ERROR: No matching distribution found for tensorflow>=1.15.0 (from kmeanstf==0.7.0a4)

但是,在pypi上存在所有版本的tensorflow(包括1.15.0和2.0.0):https://pypi.org/project/tensorflow/#history

当我将要求降低到仅“ tensorflow”(在kmeanstf == 0.7.0a1中完成)时,安装了来自Tensorflow的0.12.1版本,这对于我的软件包来说太旧了。但是,它是上述错误消息中提到的两个版本之一。确实是pypi上默认的0.12.1吗?

我在这里可以做什么(除了要求我的软件包用户自己安装tensorflow之外)?

pip --version
pip 19.3.1 from 
/home/.../miniconda2/envs/empty/lib/python3.6/site-packages/pip (python 3.6)

1 个答案:

答案 0 :(得分:2)

您将索引URL强制设置为https://test.pypi.org/simple/,因此piphttps://test.pypi.org/project/tensorflow/处寻找张量流,只有2个版本具有适合您平台的可下载轮子。

如果要从kmeanstf安装test.pypi.org,从tensorflow安装pypi.org,则需要提供一个额外的URL:

pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ kmeanstf==0.7.0a4