matplotlib can’t find dvipng version!
I spend this morning frustrated out of my skull, trying to get my research plots working in ipython after upgrading from OS 10.5 –> OS 10.6. The main difficulty stemmed from the following error message:
File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib-0.98.6svn-py2.5-macosx-10.3-fat.egg/matplotlib/texmanager.py”, line 68, in dvipng_hack_alpharaise RuntimeError(‘Could not obtain dvipng version’)
Normally when I hit a bug like this, my first instinct is to run to google, quoting the error, and hope somebody else hit the same problem. In this case, I didn’t find any hints, and promptly decided that my OS upgrade was to blame for breaking my beloved python. And so I spend 3 hours reinstalling various configurations of python numpy, scipy, ipython, matplotlib, readline, setuptools, and so on, and managed to break a great many things in the process.
And then it occurs to me; read the error message, trace through it, and find out whats not working; Duh. Here is the problem: when I installed a new, fresh python (2.6.4, which I have been meaning to do for a while regardless), the install was smart enough to recognize that I had TeX installed on my system (MacTeX, and TeXShop to boot), and so configured plotting with matplotlib to utilize the pretty typesetting of TeX. The only problem was that my TeX distribution is apparently not in the path of my shells; all I had to do was add:
export PATH=”$PATH:/usr/texbin”
… to my .zshrc file, and now everything is just like normal. Ugh, back to work…
-n
Advertisement
I was about to embark on the very same three hour journey…
Thanks!
Hello Nicholas,
I’m having this very same problem in my mac, and I badly need Tex in matplotlib. Could you please explain how to add that line to the .zshrc file? I’ve no clue how to make that.
Many, many thanks
Pablo