在 python 3.5 Anaconda distro conda env 中安装 TensorFlow
Installing TensorFlow in python 3.5 Anaconda distro conda env
我为解决这个问题所做的工作:
- 使用 Mac OS X
- 使用我电脑中当前的 Anaconda 发行版作为路径
/Users/hongshuhong/anaconda/
- 因为我的发行版 python,所以使用了 conda 而不是 virtualenv。我在这里参考了指南并尝试使用 conda 的包管理器下载相同的指南:https://www.tensorflow.org/versions/master/get_started/os_setup.html#download-and-setup
- 当我使用命令
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。
- 我试图在 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了。
打包的TensorFlow版本here是0.5版本
Python 3.x 支持是在 TensorFlow 0.6 中引入的,因此您需要弄清楚如何将最新版本安装到 Anaconda 中。
通常你可以使用 pip
将包安装到 anaconda 中,但我用 TensorFlow 没有成功。
编辑:我刚刚注意到文档没有将 url 更新到 pip-wheel。
要通过 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
我为解决这个问题所做的工作:
- 使用 Mac OS X
- 使用我电脑中当前的 Anaconda 发行版作为路径
/Users/hongshuhong/anaconda/
- 因为我的发行版 python,所以使用了 conda 而不是 virtualenv。我在这里参考了指南并尝试使用 conda 的包管理器下载相同的指南:https://www.tensorflow.org/versions/master/get_started/os_setup.html#download-and-setup
- 当我使用命令
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。
- 我试图在 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了。
打包的TensorFlow版本here是0.5版本
Python 3.x 支持是在 TensorFlow 0.6 中引入的,因此您需要弄清楚如何将最新版本安装到 Anaconda 中。
通常你可以使用 pip
将包安装到 anaconda 中,但我用 TensorFlow 没有成功。
编辑:我刚刚注意到文档没有将 url 更新到 pip-wheel。
要通过 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