python - AttributeError: 'module' object has no attribute 'cbook' -
i trying run simple code , have dependencies matplotlib , numpy installed in canopy. still getting error.
import cv2 import numpy np import matplotlib.pyplot plt x = cv2.imread('jay.jpg') plt.imshow(x, cmap = 'gray', interpolation = 'bicubic') plt.xticks([]), plt.yticks([]) # hide tick values on x , y axis plt.show()
error:
%run "c:\users\jay\appdata\local\temp\tmppvibq9.py" --------------------------------------------------------------------------- attributeerror traceback (most recent call last) c:\users\jay\appdata\local\temp\tmppvibq9.py in <module>() 2 import numpy np 3 import matplotlib.cbook ----> 4 import matplotlib.pyplot plt 5 6 x = cv2.imread('jay.jpg') c:\users\jay\appdata\local\enthought\canopy\system\lib\site-packages\matplotlib\pyplot.py in <module>() 27 cycler import cycler 28 import matplotlib ---> 29 import matplotlib.colorbar 30 matplotlib import style 31 matplotlib import _pylab_helpers, interactive c:\users\jay\appdata\local\enthought\canopy\system\lib\site-packages\matplotlib\colorbar.py in <module>() 30 31 import matplotlib mpl ---> 32 import matplotlib.artist martist 33 import matplotlib.cbook cbook 34 import matplotlib.collections collections c:\users\jay\appdata\local\enthought\canopy\system\lib\site-packages\matplotlib\artist.py in <module>() 9 import numpy np 10 import matplotlib ---> 11 import matplotlib.cbook cbook 12 matplotlib.cbook import mpldeprecation 13 matplotlib import docstring, rcparams attributeerror: 'module' object has no attribute 'cbook'
dependencies have installed numpy , matplotlib: 1.) libsvm-3.17.win64-py2.7 2.) pyparsing-2.0.3-1.win64-py2.7 3.) python-dateutil-2.4.2-2.win64-py2.7 4.) pytz-2015.7-1.win64-py2.7 5.) six-1.10.0-1.win64-py2.7 6.) scipy-0.13.3.win64-py2.7 7.) numpy-mkl-1.9.2-2.win64-py2.7 8.) matplotlib 1.5.1-win64-py2.7 9.) pip 8.0.2-1.win64-py2.7
i don't know sure causing problem, running code in wrong python environment: c:\users\jay\appdata\local\enthought\canopy\system\ should running in c:\users\jay\appdata\local\enthought\canopy\user
see https://support.enthought.com/entries/23646538-make-canopy-user-python-be-your-default-python
Comments
Post a Comment