[IPython-User] Why is iPython using X11?

Piet van Oostrum piet@vanoostrum....
Wed Nov 10 14:57:22 CST 2010

David Warde-Farley wrote:

 > On 2010-11-10, at 7:36 AM, Piet van Oostrum wrote:
 > >  have installed iPython 0.10.1 on my MacBook with Mac OS X Snow
 > > Leopard (10.6.4) and when I start it it starts up X11. I would like
 > > to know what is causing this and how I can prevent this because I
 > > don't want to use X11 with it. It is not matplotlib I think because
 > > importing matplotlib in a normal Python session doesn't do this,
 > > and I have configured it to use Aquaterm for displaying plots. The
 > > previous version I had installed (I guess 0.9 something) didn't do
 > > this.
 > What version of Python are you using? Is it a version from Fink? Fink
 > Python does weird things sometimes.. Are you invoking with -pylab?
 > Importing matplotlib would not necessarily trigger the same
 > behaviour.
 > Can you print the result of matplotlib.get_backend()? What do you
 > mean AquaTerm is displaying plots?

I am using MacPython 2.6.5 installed with the Mac installer from www.python.org. I have no fink stuff on my machine, but I do have macports stuff.

When starting ipython from the command line without parameters it loads X11 as indicated by this message:

Xlib:  extension "RANDR" missing on display "/tmp/launch-s9Lniv/org.x:0".

When I remove matplotlib from my installation and start with ipython -pylab it complains about matplotlib not being imported but doesn't start X11.

So I reinstalled matplotlib 1.0.0 from the binary installer and when I run ipython -pylab it did start X11 but then crashed with a 'bus error'.
The crash seems to be caused in matplotlib/ft2font.so according to the crash report. 
Therefore I tried to install matplotlib from source but that fails as it wants to have certain libraries in ppc version (freetype, zlib and libxml) and I don't have ppc support for these, because I don't need it. I don't know how to shut off ppc support in the matplotlib installation.
By the way the installation procedure also starts X11, probably in probing the GTK backend. So it seems to be that. I don't need GTK, so I disabled it in setup.cfg.

Searching on the internet for this crash in ft2font.so I found:


And with the help of this I managed to recompile matplotlib, and with the disabling of GTK I now have a working pylab without crashes and without X11. Anyway it seems that the distributed versions of matplotlib for Mac OS X 10.6 have a problem.

In [3]: matplotlib.get_backend()
Out[3]: 'MacOSX'

Aquaterm is a plotting front-end for Mac OS X (http://aquaterm.sourceforge.net), and it can be used for example for gnuplot. But I think I was mistaken that it was used as output device. It only superficially looked like it.

Piet van Oostrum
Cochabamba. URL: http://pietvanoostrum.com/
Nu Fair Trade woonartikelen op http://www.zylja.com

More information about the IPython-User mailing list