matplotlib in cygwin

Does anyone have any idea why matplotlib now crashes python under cygwin? Here's what I did:

1. Install cygwin, including gcc, python, and the libpng and libfreetype development packages.
2. Install Numeric 24.2 from tar.gz file. This works fine.
3. Install matplotlib from svn. This works fine.
4. Execute "from pylab import *" inside python. Instant dump to the bash shell without error message. Setting verbose=debug-annoying doesn't add any information.

Let's show the whole thing in gory detail, shall we?

···

-----------------------------
freedryk@...346... ~
$ python
Python 2.4.1 (#1, May 27 2005, 18:02:40)
[GCC 3.3.3 (cygwin special)] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pylab import *
loaded rc file /cygdrive/d/freedryk/.matplotlib/matplotlibrc
matplotlib version 0.88
verbose.level debug-annoying
interactive is False
platform is cygwin
loaded modules: ['pylab', '_bisect', '__future__', 'copy_reg', 'sre_compile', 'd
istutils', 'itertools', '_sre', '__main__', 'site', '__builtin__', 'datetime', '
matplotlib.re', 'matplotlib.tempfile', 'encodings', 'pytz.datetime', 'shutil', '
distutils.string', 'dateutil', 'matplotlib.datetime', 'posixpath', '_random', 't
empfile', 'errno', 'matplotlib.warnings', 'binascii', 'encodings.codecs', 'sre_c
onstants', 're', 'matplotlib.md5', 'os.path', 'pytz.sys', '_codecs', 'distutils.
sysconfig', 'encodings.exceptions', 'pytz.sets', 'math', 'fcntl', 'stat', 'zipim
port', 'string', 'warnings', 'encodings.types', 'UserDict', 'encodings.ascii', '
matplotlib.sys', 'matplotlib', 'distutils.os', 'sys', 'pytz.tzinfo', 'pytz', 'ma
tplotlib.__future__', 'codecs', 'distutils.re', 'readline', 'matplotlib.pytz', '
types', 'md5', 'matplotlib.dateutil', 'matplotlib.os', 'thread', 'sre', 'bisect'
, 'matplotlib.distutils', 'signal', 'distutils.errors', 'random', 'linecache', '
matplotlib.shutil', 'posix', 'encodings.aliases', 'sets', 'exceptions', 'sre_par
se', 'pytz.bisect', 'distutils.sys', 'os', 'strop']
numerix Numeric 24.2

freedryk@...346... ~
$
--------------------------------

I've tried this with Numeric 24.2, Numeric 24.0, numpy 0.9.6, matplotlib svn, matplotlib-0.86, and matplotlib-0.74; all give the same result. I believe this is a problem with cygwin, because a year or so ago I installed matplotlib-0.74 with Numeric-24.0 and it worked fine. Note that "import matplotlib" appears to work, but "import matplotlib.pylab" does not. Any idea what's going wrong, or suggestions about where to start hacking?

Jordan Dawe

First thing to try is simply rm -rf the site-packages/matplotlib and
build subdirs and get a clean install. Installing a new version over
a pretty old version has been known to cause trouble, segfault, etc.
  

I always wipe the install and build directories before installing a new version.

Try importing these packages individually

  import matplotlib._image
  import matplotlib._transforms

  #one of these three depending on which numerix package you are using
  import matplotlib.backends._na_backend_agg # for numarray
  import matplotlib.backends._nc_backend_agg # for Numeric
  import matplotlib.backends._ns_backend_agg # for numpy

  import matplotlib.backends._tkagg
  import matplotlib._agg
  

All of them simply dump to the command line (though I only tried Numeric, not numpy or numarray).

If that shed additional light, again flush the build and install dirs,
and try setting VERBOSE=True in setup.py before doing a clean install.
The VERBOSE setting will generate lots of extra output and may help
indicate where the segfault is occurring

Hmm. There are a bunch of warnings that one might be using variables uninitialized (which I'm ignoring as compiler whining), and a series of warning like this:

./CXX/Extensions.hxx: In constructor `Py::PythonExtension<T>::PythonExtension() [with T = LazyValue]':
src/_transforms.h:57: instantiated from here
./CXX/Extensions.hxx:477: warning: right-hand operand of comma has no effect

I suspect these are harmless as well, but I don't really know c++ so I can't tell what it's complaining about.

Jordan