Daniel
Daniel

Reputation: 33

Matplotlib in Tensorflow Jupyter Notebook

In Anaconda Navigator, I switched to running applications on tensorflow and installed jupyter 5.6.0. I then open up a Python3 notebook. I then import tensorflow, keras and numpy without issue. Then when I try to import matplotlib, the notebook says ImportError: No module named 'matplotlib'.

I tried running the following command in my anaconda prompt in both base and after activating tensorflow: pip3 install matplotlib

And it says:

(tensorflow) C:\Users\danie>pip3 install matplotlib Requirement already satisfied

for 7 different lines. What am I doing wrong?

Upvotes: 0

Views: 1150

Answers (2)

Athanasios Manassas
Athanasios Manassas

Reputation: 1

! pip install matplotlib ,worked perfect for me in the tensorflow environment (Jupyter)

Upvotes: 0

J. Blackadar
J. Blackadar

Reputation: 1961

Add import sys and sys.executable to the top of your notebook, then run it. This shows you the directory of the running kernel. With this information, from a new command-line (not a Python console) run C:\path\to\python.exe -m pip install matplotlib

Upvotes: 1

Related Questions