【问题标题】:only old tensorflow version found when installing my new package from pypi [duplicate]从 pypi 安装我的新软件包时仅找到旧的 tensorflow 版本 [重复]
【发布时间】:2020-04-19 15:06:24
【问题描述】:

我在 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 版本,这对于我的包来说太古老了。但是,它是上述错误消息中提到的两个版本之一。 0.12.1 确实是 pypi 的默认值吗?

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

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

【问题讨论】:

    标签: python tensorflow pip pypi


    【解决方案1】:

    您强制索引 URL 为 https://test.pypi.org/simple/,因此 piphttps://test.pypi.org/project/tensorflow/ 查找 tensorflow,并且只有 2 个版本具有适合您平台的可下载轮子。

    如果您想从test.pypi.org 安装kmeanstf 和从pypi.org 安装tensorflow,您需要提供额外的网址:

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

    【讨论】:

      猜你喜欢
      • 2014-09-26
      • 2019-02-15
      • 2018-12-29
      • 2014-06-23
      • 2011-04-27
      • 2014-03-03
      • 2017-06-05
      • 1970-01-01
      • 2015-08-25
      相关资源
      最近更新 更多