[Pythonmac-SIG] matplotlib

Charles Hartman charles.hartman at conncoll.edu
Sun Nov 1 16:50:27 CET 2009


> Did you try one of the 2.6 installers from the sourceforge download  
> page:
> matplotlib-0.99.1.1-py2.6-macosx10.5.dmg
> matplotlib-0.99.1.1-py2.6-macosx-10.3-fat.egg
>

Yes -- dumb!  I just downloaded the wrong (2.5) installer; wherever I  
originally got it, the 2.6 wasn't present.

So now I've installed it, and I can do 'import matplotlib' in Python.   
But when I try to use it (on an example from the new "Natural Language  
Processing with Python"), here's what I get:

 >>> import matplotlib
 >>> text4.dispersion_plot(["citizens", "democracy", "freedom",  
"duties", "America"])
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ 
python2.6/site-packages/nltk/text.py", line 452, in dispersion_plot
     dispersion_plot(self, words)
   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ 
python2.6/site-packages/nltk/draw/dispersion.py", line 25, in  
dispersion_plot
     raise ValueError('The plot function requires the matplotlib  
package.'
ValueError: The plot function requires the matplotlib package.See http://matplotlib.sourceforge.net/
 >>>

Am I missing something just as obvious as before?



More information about the Pythonmac-SIG mailing list