Forums

matplotlib not working jupyternotebook

So seaborn didn't seem to be installed so I installed it using the instructions here:

https://help.pythonanywhere.com/pages/InstallingNewModules/

Once I installed it, it did update matplotlib and some other packages I don't recall. When I try to run the next it I get the following error:

module 'matplotlib.backends' has no attribute 'backend'

https://www.pythonanywhere.com/user/drudd75077/ipython_notebooks/view/py_practice/guipsamora/guipsamora%2007_Visualization%20Online_Retail.ipynb

Link above is the notebook

I tried to google it and I got some pages saying to update matplotlib which I tried to do, but that didn't appear to fix it.

Here's the bash console I used to update:

https://www.pythonanywhere.com/user/drudd75077/consoles/12673336/

Did you restart your notebook kernel after installing the package?

Yes

I see that you have installed using the --user flag into python3.6.

Are you using python3.6 in your notebook? What have you run in your notebook?

yes

What is the code that you are running in your notebook? Can you share for example what imports you have made before the matplotlib import?

import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns

%matplotlib inline

sns.set(style='ticks')

I put the link in op you're welcome to login and run it

See this. Your import + notebook magic execution order is making matplotlib confused.