简体   繁体   中英

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). 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. How can I do this?

First, make sure that you nb_conda installed which provides conda environment and package access extension from within Jupyter.

conda install nb_conda

Create an environment with Python 2.7. And then install tensorflow inside the environment. This should be accessible to 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:

conda install tensorflow=1.1.0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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