close

[Solved] No module named tensorflow in jupyter

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error No module named tensorflow in jupyter in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How No module named tensorflow in jupyter Error Occurs?

Today I get the following error No module named tensorflow in jupyter in python.

How To Solve No module named tensorflow in jupyter Error ?

  1. How To Solve No module named tensorflow in jupyter Error ?

    To Solve No module named tensorflow in jupyter Error To use it within the the Anaconda environment, it needs to point to the conda env you are using, and look something like Anaconda3\envs\Env_Name\share\jupyter\kernels\python3.

  2. No module named tensorflow in jupyter

    To Solve No module named tensorflow in jupyter Error To use it within the the Anaconda environment, it needs to point to the conda env you are using, and look something like Anaconda3\envs\Env_Name\share\jupyter\kernels\python3.

Solution 1

I mean creating an environment called tensorflow and tested your installation in python, but TensorFlow can not be imported in jupyter, you have to install jupyter in your tensorflow environment too:

conda install jupyter notebook

After that I run a jupyter and it can import TensorFlow too:

jupyter notebook

Solution 2

I had the same problem, and solved it by looking at the output of:

jupyter kernelspec list

which outputs the kernel information:

python2 /Users/Username/Library/Jupyter/kernels/python2 
python3 /Users/Username/Library/Jupyter/kernels/python3

Notice that the path points to the Jupyter kernel for the user. To use it within the the Anaconda environment, it needs to point to the conda env you are using, and look something like Anaconda3\envs\Env_Name\share\jupyter\kernels\python3.

So, to remove the Jupyter kernelspec, just use:

jupyter kernelspec remove python3

or jupyter kernelspec remove python2 if you’re using python 2

Now, the output of jupyter kernelspec list should point to the correct kernel.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read