1

in:

import matplotlib.pyplot as plt
%matplotlib inline

df.plot()

Gives:

ImportError: matplotlib is required for plotting.

I installed matplotlib through pip, and showing it gives:

Location: c:\users\miscs\appdata\local\programs\python\python36\lib\site-packages

in Jupyter, sys.executable outputs:

'C:\\Users\\miscs\\AppData\\Local\\Programs\\Python\\Python36\\python.exe'

Why is this error occurring and how can I fix it?

1
  • what happens when you execute a cell with this import matplotlib Commented Jun 19, 2018 at 11:58

1 Answer 1

1

Just ran into the same error, resolved it thus:

I did pip install matplotlib in my virtualenv, and then I ran import matplotlib which succeeded, but the df.plot() step still gave me the ImportError: matplotlib is required for plotting. error.

Saved my Jupyter notebook, killed and restarted the Jupyter notebook server, and reopened the notebook. Didn't face the error again.

I guess matplotlib needs to be installed and available before the notebook is started.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.