#97 Importing PyOpenGL can cause fatal Python error

Jack Jansen

Apparently there is a situation where importing PyOpenGL
can raise a fatal Python error with the message "Fatal
Python error: Can't import module 'numarray.libnumarray'".

This may be due to an installation problem with numarray (I
haven't tried to repeat this), but the fatal error is a definite
no-no: the import of PyOpenGL should fail at worst.

The problem of the fatal error becomes serious when using
the MacPython Package Manager, an automated package
installation tool: as soon as this situation has occurred once
Package Manager no longer runs, because it tries to obtain
the PyOpenGL version number at startup. So the poor end
user also has no way of figuring out what is going on...

And because of the fatal error there is also no workaround I
can do in Package Manager itself.


  • Logged In: YES

    Strange, python doesn't AFAIK have any numarray-aware code
    at all. That is, it uses numpy (the older precursor to
    numarray). Not sure why anything would be picking up a
    reference to numarray when importing PyOpenGL. Do we have
    any sort of test-case for the failure (e.g. what versions of
    everything?) I'll try to duplicate the failure on Win32
    next time I have a moment to work on PyOpenGL.

    • priority: 5 --> 8
    • assigned_to: nobody --> mcfletch
  • Jack Jansen
    Jack Jansen

    Logged In: YES

    I will ask the original poster about the exact setup, and also try to
    reproduce it.

    And on pondering the problem again: it could be that Numarray is
    the culprit. If PyOpenGL knows only about the old Numeric and
    (speculation here) numarray has some sort of Numeric-
    compatibility module it could be that the problem lies there.

  • Jack Jansen
    Jack Jansen

    Logged In: YES

    Well, Numarray is at least partially to blame: Include/numarray/
    libnumarray.h has the Py_FatalError calls, in the
    import_libnumarray() macro.

    I will file a companion bug in NumPy:-)

  • Logged In: NO

    I'm getting the same error. I did this twice from scratch.

    Install 1:

    1. install python 2.3.3
    2. install PyOpenGL-
    3. install Numeric-23.1.win32-py2.3.exe

    On doing,
    >> import OpenGL.GL

    Python crashes with message:
    Fatal Python error: Can't import module 'numarray.libnumarray'

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

    Install 2:

    1. Uninstall python 2.3 and delete dirs containing opengl
    and NumPy
    2. Reinstall python 2.3
    3. install numpy
    3. install pyopengl.

    The above import statement fails in the same way as before.

  • Logged In: YES

    Ach. Need to get the documentation updated. For some
    reason the binary installer for win32 appears to have been
    built against NumArray instead of NumPy. Try uninstalling
    Numpy and installing NumArray and see if that fixes the problem.

  • Logged In: NO

    I just installed numarray-0.8.win32-py2.3.exe to the
    previous configuration and all my gl apps are now working.


    • status: open --> closed-fixed
  • Logged In: YES
    user_id=34901 Python 2.3 release is built without Numarray
    dependency, and runs without it. Marking the bug closed.