Hi,
I'm having trouble getting pyplot and pylab to work on my Mac v.10.4.11
(Tiger). I've tried searching in both google and different macusers
forums, but haven't found an answer to my problems. If I have overlooked a
webpage please send me a link to the solution.
To download matplotlib I have downloaded the dmg package from the official
matplotlib page
and it seems to install fine. However, I cannot use neither pyplot nor
pylab:
[kariannelap:~] karianne% python
Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53)
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import matplotlib as mpl
import mpl.pyplot
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named mpl.pyplot
import mpl.pylab
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named mpl.pylab
import pylab
Bus error
I tried the clean rebuild and reinstall described on this page:
http://matplotlib.sourceforge.net/faq/installing_faq.html#cleanly-rebuild-and-reinstall-everything
and re-installed without any change. So then I tried deleting all
matplotlib and pylab files and dirs and re-installed, again without
results. I also tried this installation method without success
easy_install matplotlib
Processing matplotlib
error: Not a recognized archive type: matplotlib
Some more info:
[kariannelap:~] karianne% uname -a
Darwin karianneholhjem.local 8.11.1 Darwin Kernel Version 8.11.1: Wed Oct 10 18:23:28 PDT 2007; root:xnu
-792.25.20~1/RELEASE_I386 i386 i386
[kariannelap:~] karianne% python -c 'import matplotlib; print
matplotlib.__version__'
1.0.0
Regarding the matplotlibrc file I have tried both the default
backend : TkAgg
as well as
backend : WxAgg
since some webpages indicated that might be a problem.
Finally, I wrote a little script called bla.py
import matplotlib as mpl
import mpl.pyplot
import mpl.pylab
and ran it
[kariannelap:~] karianne% python bla.py --verbose-helpful
$HOME=/Users/karianne
CONFIGDIR=/Users/karianne/.matplotlib
matplotlib data path
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matpl
otlib/mpl-data
loaded rc file
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/
mpl-data/matplotlibrc
matplotlib version 1.0.0
verbose.level helpful
interactive is False
units is False
platform is darwin
Traceback (most recent call last):
File "bla.py", line 2, in <module>
import mpl.pyplot
ImportError: No module named mpl.pyplot
When commenting out line 2 in the scrip this is the output I got:
$HOME=/Users/karianne
CONFIGDIR=/Users/karianne/.matplotlib
matplotlib data path
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matpl
otlib/mpl-data
loaded rc file
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/
mpl-data/matplotlibrc
matplotlib version 1.0.0
verbose.level helpful
interactive is False
units is False
platform is darwin
Traceback (most recent call last):
File "bla.py", line 3, in <module>
import mpl.pylab
ImportError: No module named mpl.pylab
Can someone please tell me what I am doing wrong or which files I should
delete to make this work? I have had bad experiences with fink so I prefer
not using it.
cheers,
Karianne