简体   繁体   English

在Anaconda中为python 3和python 2内核安装TensorFlow

[英]Installing TensorFlow in Anaconda for both python 3 and python 2 kernels

I have Python 3 and Python 2 kernels on Jupyter(I installed Anaconda with Python 3 and then I added Python2). 我在Jupyter上有Python 3和Python 2内核(我在Python 3上安装了Anaconda,然后添加了Python2)。 I installed TensorFlow with Anaconda and it works in Python 3 kernel but it seems that I have to install it for Python 2 as well. 我在Anaconda上安装了TensorFlow,它在Python 3内核中工作,但看来我也必须在Python 2上安装它。 How can I do this? 我怎样才能做到这一点?

First, make sure that you nb_conda installed which provides conda environment and package access extension from within Jupyter. 首先,请确保您已安装nb_conda,它从Jupyter内部提供了conda环境和程序包访问扩展。

conda install nb_conda

Create an environment with Python 2.7. 使用Python 2.7创建环境。 And then install tensorflow inside the environment. 然后在环境中安装tensorflow。 This should be accessible to Jupyter. Jupyter应该可以访问它。

conda create --name tensorflow27 python=2.7 anaconda
source activate tensorflow27
conda install -c conda-forge tensorflow=1.0.0

Or if you want version 1.1.0 instead: 或者,如果您想要版本1.1.0而不是:

conda install tensorflow=1.1.0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM