crash on matplotlib.matlab import on win32

Message
Hello All,

I just tried to install matplotlib on a WinXP computer, after a successfull install on Linux.

The problem I encounter is the following (transcript of an interractive session):

···

C:\Python23>python
Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.

import matplotlib
matplotlib.use(“TkAgg”)
from matplotlib.matlab import *
Assertion failed: ob_refcnt == 0, file CXX/cxx_extensions.cxx, line 1031

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application’s support team for more information.

C:\Python23>


This work on Linux, and I can not find any hint in the doc to a backend/python interpreter incompatibility explaining this error.

I use numarray version 0.9 (win installer), python 2.3.4 (as shown in the session transcript), and matplotlib 0.54.2, last windows installer (the 2004/06/08 21:54:42 build which I think correct some problems with numarray)

Now I am wondering if I do something I shouldn’t, if my system or installation is responsible, or if it is a bug in this particular matplotlib distribution…Any idea?

Best regards,

Greg.

I tried this configuration on Windows 2000 Pro and it worked fine.

I haven't tried this configuration on Windows XP yet... I'll try later
to see if I can reproduce the problem.

Regards,
Todd

···

On Wed, 2004-06-23 at 12:42, Gregory Lielens wrote:

Hello All,
I just tried to install matplotlib on a WinXP computer, after a
successfull install on Linux.
The problem I encounter is the following (transcript of an
interractive session):

---
C:\Python23>python
Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)]
on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> matplotlib.use("TkAgg")
>>> from matplotlib.matlab import *
Assertion failed: ob_refcnt == 0, file CXX/cxx_extensions.cxx, line
1031

This application has requested the Runtime to terminate it in an
unusual way.
Please contact the application's support team for more information.

C:\Python23>

---

This work on Linux, and I can not find any hint in the doc to a
backend/python interpreter incompatibility explaining this error.

I use numarray version 0.9 (win installer), python 2.3.4 (as shown in
the session transcript), and matplotlib 0.54.2, last windows installer
(the 2004/06/08 21:54:42 build which I think correct some problems
with numarray)

Now I am wondering if I do something I shouldn't, if my system or
installation is responsible, or if it is a bug in this particular
matplotlib distribution...Any idea?

Thanks for helping with this problem!

I just tried on a win2000 Pro computer, and indeed, no problem...
Then, on my WinXP laptop, I removed python, reinstalled it (2.3.4), next
numarray (0.9), then matplotlib (0.54.2), the exact same windows
installers that were used on the Win2000 computer, and same problem as
before, crash on matplotlib.matlab import...Weird!

I will try to perform the same installation on another WinXP computer,
to be sure the problem is not related to incompatibilities with other
softwares installed on my laptop, or some registery entries, and keep
the list informed of the results of this test.

Best regards,

Greg.

I checked on another WinXP computer, and it works on this one - seems
that I have to play the windows re-install game, or hunt down what the
exact differences between these 2 WinXP computers are :-/...
The fact that only matplotlib exhibit this behavior is strange though, I
checked in the code (hence cc to the devel list) and the problem is
linked to an assert in the destructor of PythonExtensionBase, checking
that the ref counting of this object is 0 and exiting Python interpreter
if it is not the case...Hum, obviously I do not know the code at all,
but could the problem be linked to a destruction sequence beeing
somewhat different on my computer (for whatever reasons :-/)?
This worry me (in addition to bother me not beeing able to run
matplotlib on my laptop for the moment :wink: ), cause it may be the sign
of "difficult to solve and reproduce" installation problems for a
package we may use in a distributed software package in the future...
I will keep investigating, but if there is a developer have any idea
about this (like, a hint about why there is this assert there and what
can cause it to fail), it would be great!

Thanks a lot, and congratulation for matplotlib, it looks the most
promising python plotting packages I have found yet! :slight_smile: