AttributeError: 'module' object has no attribute 'cbook'

User 5079 | 4/27/2016, 6:19:18 AM

This is another error. When I use eclipse/Pydev I don't see these things. It is a Mac and I have a conda env. for Python 2.7. Other code works in the notebook.

     import matplotlib.pyplot as plt
     %matplotlib inline

AttributeError Traceback (most recent call last)

<ipython-input-11-385145dcc870> in <module>()

----> 1 import matplotlib.pyplot as plt

2 get_ipython().magic(u'matplotlib inline')

/Users/radhakrishnan/Documents/MLSpecializationUW/anaconda/envs/dato-env/lib/python2.7/site-packages/matplotlib/pyplot.py in <module>()

27 from cycler import cycler

28 import matplotlib

---> 29 import matplotlib.colorbar

30 from matplotlib import style

31 from matplotlib import pylabhelpers, interactive

/Users/radhakrishnan/Documents/MLSpecializationUW/anaconda/envs/dato-env/lib/python2.7/site-packages/matplotlib/colorbar.py in <module>()

30

31 import matplotlib as mpl

---> 32 import matplotlib.artist as martist

33 import matplotlib.cbook as cbook

34 import matplotlib.collections as collections

/Users/radhakrishnan/Documents/MLSpecializationUW/anaconda/envs/dato-env/lib/python2.7/site-packages/matplotlib/artist.py in <module>()

9 import numpy as np

10 import matplotlib

---> 11 import matplotlib.cbook as cbook

12 from matplotlib.cbook import mplDeprecation

13 from matplotlib import docstring, rcParams

AttributeError: 'module' object has no attribute 'cbook'

Comments

User 16 | 4/27/2016, 8:54:53 PM

Hi @MohanRadhakrishnan - This forum isn't really intended to answer matplotlib questions. I would suggest asking on Stack Overflow.


User 5079 | 4/28/2016, 6:56:54 AM

I will try. Failed to mention that it is code in an ipython notebook. I use graphlab. But I get your point.


User 5205 | 5/17/2016, 9:23:54 PM

I ran into the same issue. In my case, it was due to some messing up of env variables. My fix was to reinstall anaconda and Dato. The messing up of env variables appeared to be, though I can't be 100% sure, due to the fact that I updated anaconda after Dato was installed.


User 1207 | 5/18/2016, 5:48:06 PM

@Raymond6 -- thanks for the tip. Indeed, environment variables can mess up GLC or almost any python package. Glad you got it fixed!

-- Hoyt