I found a really weird behaviour when trying to import the module pyplot
from matplotlib
. First it says it does not exist, but after importing pylab
(another matplotlib
module), it suddently works!
>>> import matplotlib
>>> matplotlib.__version__
'1.2.1'
>>> matplotlib.pyplot
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'pyplot'
>>> import pylab
>>> matplotlib.pyplot
<module 'matplotlib.pyplot' from '/Library/Python/2.7/site-packages/matplotlib/pyplot.pyc'>
Anyone else has this behaviour in his/her computer?
** This happened on a OS X Mountain Lion, running Python 2.7. I installed matplotlib
with pip
.