How to install tensorflow in jupyter and switch the environment to tensorflow

First of all, let me say that the problems encountered are as follows (provided that anaconda has been installed):

1. Enter jupyter and open the terminal

Enter jupyter notebook in cmd to enter jupyter:

Then enter the terminal:

After entering, the interface is as follows:

2. Install tensorflow

The first is to create a tensorflow environment with a python version, where tensorflow is just a name:

conda create -n tensorflow python=3.5

The next step is to activate the environment created above:

conda activate tensorflow

After activation, tensorflow is installed, using Tsinghua source

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow

Then after the installation is complete, enter the following command:

conda env list

You can view the currently built environment

Then install ipykernel:

conda install ipykernel

After the previous step is successful, the last step is to enter the following command line. The local environment refers to the name of the environment just created:

python -m ipykernel install --user --name local environment name --display-name "name displayed on jupyter"

Tensorflow appears in the list after refreshing, if not, exit jupyter and re-enter.

The tensorflow environment appears here, and clicking tensorflow will create a new interface.

At this point we put aI copied the problematic code at the beginning and found that it has been solved.

Leave a Reply

Your email address will not be published. Required fields are marked *