Matplotlib "show()" error Mac OS X Lion

In article
<1320891765.14646.YahooMailClassic@...3849...>,
Michiel de Hoon <mjldehoon@...9...>
wrote:

> There is no matplotlib binary for 64-bit Python yet because
> I've not
> figured out how to build one successfully -- I get horrible
> conflicts
> with Tcl/Tk.
>
Would it be possible to release a matplotlib binary for 64-bit Python using
the MacOSX backend instead of tkagg?

It's not hard to build your own 64-bit matplotlib on 10.6 (and I assume
the instructions are the same on 10.7, but perhaps not). The
prerequisite libraries are already present. Just make sure you have the
following installed:
- XCode with gcc 4.2 as the default compiler (one way to change the
default is using a pair of symlinks in /usr/bin or /usr/local/bin -- one
for gcc, one for g++)
- Python.org's 64-bit python installed and preferably running as the
default.

Download and unpack the matplotlib source.
Edit setupext.py and change the entry for darwin to include those two
directories: /usr/X11 and /usr/lib.

Then copy setup.cfg.template to setup.cfg and edit setup.cfg to enable
the backends you want. Be sure to disable TkAgg because it won't build
properly.

Then build in the usual way:
python setup.py build
python setup.py install

I personally don't think the matplotlib project should serve such a
product unless and until somebody has time to deal with the Tk linking
issues, which apparently require editing some resulting libraries (more
than I want to attempt). But that's just my opinion.

-- Russell

···

--- On Wed, 11/9/11, Russell E. Owen <rowen@...2756...> > wrote:

Hi,

install-matplotlib-OSXLion_3 (1000 KB)

···

---
As a test, try to set your backend to either 'cocoaagg' or 'macosx' like so:

import matplotlib as mpl
mpl.use('cocoaagg')
---

I tried doing the above but this required me to install something called PyObjC:

The CococaAgg backend required PyObjC to be installed!

  (currently testing v1.3.7)

when I tried to easy_install PyObjC it gave me the following error:

Unknown distribution option: 'use_2to3'
  warnings.warn(msg)
error: Could not find required distribution pyobjc-core

----

I suspect you are trying to install matplotlib on the 64-bit Python

instead of the 32-bit python for which it was built
----
Well, I do use the python-32 bit version for all the work and in fact, the bumpy and scipy have been built for the python-32 bit. and i am having trouble with matplotlib on this - in fact, none of the bumpy, scipy, and python etc modules even load on the 64-bit version.

----
Download and unpack the matplotlib source.
Edit setupext.py and change the entry for darwin to include those two
directories: /usr/X11 and /usr/lib.
----
I did try this way as well, but the build does not manage to detect the libpng15 library in the X11 directory - somehow it uses "lpng15" marker and does not end up finding it when it is right there under X11's nose. I am attaching the detailed shell text for this step with this mail.

Regards,
Bedartha