【问题标题】:Installing TensorFlow in python 3.5 Anaconda distro conda env在 python 3.5 Anaconda 发行版 conda env 中安装 TensorFlow
【发布时间】:2016-01-26 04:47:11
【问题描述】:

我做了什么来尝试解决这个问题:


  1. 使用 Mac OS X
  2. 使用当前在我的计算机中的 Anaconda 发行版作为路径 /Users/hongshuhong/anaconda/
  3. 使用 conda 而不是 virtualenv 因为我的 python 分布。我在这里参考了指南并尝试使用 conda 的包管理器下载相同的内容:https://www.tensorflow.org/versions/master/get_started/os_setup.html#download-and-setup
  4. 当我使用命令conda create --name ML python=2.7 anaconda 创建 anaconda 环境时,Tensorflow 工作正常,说明我使用的是 2.7 python,然后使用从 Anaconda Cloud 收集的命令conda install -c https://conda.anaconda.org/jjhelmus tensorflow 尝试下载它。当我说的时候它起作用了
$ python
>>> import tensorflow as tf
...

但是,它并不能真正解决问题:


但是,我想用python的3.5发行版,只是为了跟上时代的步伐,不要使用过时的python。

  1. 我尝试在 python=3.5 中使用相同的方式下载它,但是当我尝试运行命令 conda install -c https://conda.anaconda.org/jjhelmus tensorflow 时出现此错误:
Hint: the following packages conflict with each other:
  - tensorflow
  - python 3.5*
Use 'conda info tensorflow' etc. to see the dependencies for each package.

然后我运行conda info tensorflow 看看发生了什么,我得到了:

Fetching package metadata: ....
Error: No packages found in current osx-64 channels matching: tensorflow

这真的让我很沮丧,我不知道该怎么办。如果没有解决方法,我想我将不得不使用 Anaconda 的 python 2.7 发行版进行 TensorFlow 实验。如果有人知道如何解决这个兼容性问题(或其他类型的问题),我将非常感激。谢谢。

编辑:我很确定 TensorFlow 支持 3.5,因为在他们的文档中他们说他们支持 2.7 python 和 3.3+。如果不知道他们是否支持3.5,我现在已经放弃并使用2.7了。

【问题讨论】:

    标签: python python-3.x virtualenv anaconda tensorflow


    【解决方案1】:

    here打包的TensorFlow版本为0.5版。

    TensorFlow 0.6 中引入了 Python 3.x 支持,因此您需要弄清楚如何将最新版本安装到 Anaconda 中。

    通常你可以使用 pip 将包安装到 anaconda 中,但我没有成功使用 TensorFlow。

    编辑:我刚刚注意到文档没有更新 pip-wheel 的 url。

    要通过 pip 在 python 3.5 中安装 tensorflow,请使用以下命令:

    $ sudo easy_install --upgrade six
    $ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.6.0-py3-none-any.whl
    

    This links...tensorflow-0.5.0-py2-none-any.whl,即python 2.x 的旧版 tensorflow。

    Tensorflow get started page link.

    【讨论】:

    • 非常感谢!这非常有帮助。我不知道 python 3.x 支持仅适用于 tensorflow 0.6 及更高版本。好收获!
    • Cannot remove entries from nonexistent file /Users/Mu/Sync/anaconda/lib/python3.5/site-packages/easy-install.pth 我曾经能够让这个命令工作,但在这台机器上安装它不起作用:/
    猜你喜欢
    • 1970-01-01
    • 2017-09-05
    • 1970-01-01
    • 1970-01-01
    • 2018-03-29
    • 1970-01-01
    • 2018-06-30
    • 1970-01-01
    • 2015-11-03
    相关资源
    最近更新 更多