Archive for December, 2010
Installing matplotlib on Mac OSX
I have had a god-awful time installing matplotlib for Mac OSX. I thought it was going to be easy to port my python development environment from Ubuntu to my new(ish) macbook pro, but NO.
I found myself googling errors like:
matplotlib tar: unrecognized archive format: inappropriate file type or format
(when the matplotlib make file had incorrect args for an untar of libpng)
no module named matplotlib.pyplot
(when an incorrect version of matplotlib was installed)
matplotlib ImportError: No module named ma
(when an incorrect version, 0.91 of matplotlib was installed)
matplotlib lipo: can’t open input file: /var/folders/8e/8efpckbcfb4dgr+x8n3urk+++tq/-tmp-//ccczosb6.out (no such file or directory)
(when baby jesus didn’t come on time)
matplotlib requires system python 2.6 to install
(when trying to install from dpkg)
and several other problems.
HERE IS HOW I GOT IT TO WORK
1. Install freetype2
- get freetype from http://gnu.mirrors.pair.com/savannah/savannah/freetype/freetype-2.4.4.tar.gz , which is the most current as of 12-2010
- a standard install:
./configure
make
sudo make install
2. Install libpng
- get libpng from http://ethan.tira-thompson.org/Mac_OS_X_Ports.html
- a standard install:
./configure
make
sudo make install
3. Install matplotlib from source
- get matplotlib version > 0.9. version 0.9 is totally out of date and should not be used
- do not use “pip install matplotlib”. matplotlib developers have not properly updated their link with pypi, and “pip install matplotlib” will install the OLD and USELESS version of matplotlib.
- Instead, get the source from: http://superb-sea2.dl.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.0/matplotlib-1.0.0.tar.gz
- python setup.py build
At this point, it MUST recognize your freetype2 with the correct version:
REQUIRED DEPENDENCIES
numpy: 1.2.1
freetype2: 12.2.6
If it continues without a real version number beside freetype2, it WILL FAIL. I don’t know why the installer continues, as it certainly should not. If a matplotlib developer reads this, please correct!
- If this step finishes without errors, you’re golden
- python setup.py install
and you’re golden!
I have burned 3 hours on this sh** when I should have been writing my thesis. Hope this helps others out there.
2 commentsCortez the Killer
A lost gem by Neil Young – Cortez the Killer. This song is an awesome jam. Dave Matthews and several other notables have covered this song, but check out the original below.
No comments