找不到满足要求tensorflow == 1.0.1的版本?

时间:2018-01-04 07:02:43

标签: python tensorflow

过去6个小时我一直在与这个问题作斗争,所以我决定发一个问题并回答我自己的问题,以防其他人有同样的问题。

为什么以下行:

pip install -r requirements.txt

导致以下错误?

The directory '/Users/ruchirbaronia/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

 Could not find a version that satisfies the requirement tensorflow==1.0.1 (from -r requirements.txt (line 16)) (from versions: 0.12.1, 1.0.0, 1.1.0rc0, 1.1.0rc1, 1.1.0rc2, 1.1.0, 1.2.0rc0, 1.2.0rc1, 1.2.0rc2, 1.2.0, 1.2.1, 1.3.0rc0, 1.3.0rc1, 1.3.0rc2, 1.3.0, 1.4.0rc0, 1.4.0rc1, 1.4.0, 1.4.1, 1.5.0rc0)
No matching distribution found for tensorflow==1.0.1 (from -r requirements.txt (line 16))

我尝试升级Tensorflow,重新安装pip,我的python版本是3.6(支持),甚至使用来自Google的官方链接的多个版本重新安装了pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.1.0-py2-none-any.whl的tensorflow 。为什么midi-rnn仍无法正常工作?

1 个答案:

答案 0 :(得分:0)

pip install -r requirements.txt

上一行导致超过9000次疯狂谷歌搜索,并导致以下两个错误,具体取决于我是否使用sudo(分别):

The directory '/Users/ruchirbaronia/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

 Could not find a version that satisfies the requirement tensorflow==1.0.1 (from -r requirements.txt (line 16)) (from versions: 0.12.1, 1.0.0, 1.1.0rc0, 1.1.0rc1, 1.1.0rc2, 1.1.0, 1.2.0rc0, 1.2.0rc1, 1.2.0rc2, 1.2.0, 1.2.1, 1.3.0rc0, 1.3.0rc1, 1.3.0rc2, 1.3.0, 1.4.0rc0, 1.4.0rc1, 1.4.0, 1.4.1, 1.5.0rc0)
No matching distribution found for tensorflow==1.0.1 (from -r requirements.txt (line 16))

虽然这些错误很冗长,但它们的描述性不足以让我能够查明我的问题。事实证明,midi-rnn无效的原因是python(3.6)的版本与张量流的版本(1.0.1)发生冲突。那我是怎么解决的呢?

您可以通过conda create --name tensorflow python=3.5

创建并激活python版本3.5的新环境

这将使用3.5版创建一个新的python环境。在这样做之后,安装requirements.txt是件小事,我能够开始训练我的神经网络!