_opengl mystery

plewis patrick-lewisNOpaSPAM at yahoo.com.invalid
Thu Feb 3 10:10:03 EST 2000


I guess the short answer is uninstall the python-opengl rpm.  It
is only necessary if you want to run applications that use
OpenGL.  But, you want OpenGL to work, right?

I have a Debian system, so things could be a little different for
you, but here's what you should check:

line 2 in /usr/lib/python1.5/site-packages/OpenGL/GL/__init__.py
is "import OpenGL". (This file is imported when "from OpenGL.GL"
is called). This causes your
/usr/lib/python1.5/site-packages/OpenGL/__init__.py to load.

line 1 of OpenGL/__init__.py is "import OpenGL.shared".  This
loads /usr/lib/python1.5/site-packages/OpenGL/shared/__init__.py
into Python.  On my system OpenGL/shared/__init__.py is:

import sys,os
sys.path.insert(0, __path__[0]+os.sep+sys.platform)

This should insert (big breath)
/usr/lib/python1.5/site-packages/OpenGL/shared/linux2 into the
search path that Python looks for modules.

I suspect something described above is not the same on your
system (i.e. it is broken).  Because, now OpenGL.GL should be
able to call

from _opengl import *

and Python will be able to find your system's _openglmodule.so.

As to your specific questions

>1) Why would this module import another module that doesn't
exist?

It does exist, Python just can't find it. :)

>
>2) Where can I get these modules (either the numeric or the
>_opengl).  I
>have installed
>        python-doc-html-1.5.2-1.noarch.rpm
>        python-opengl-1.5.5-2.i386.rpm
>        python-imaging-1.0b1-3.i386.rpm
>        python-tkinter-1.5.2-2.i386.rpm
>        python-imaging-_tkinter-1.0b1-3.i386.rpm
>and all the supporting libs, but none of these have _opengl in
>them

The numeric homepage is at http://numpy.sourceforge.net.  I have
no idea if there is an rpm for it; I couldn't find one with a
quick search at redhat.com.  You may or may not need it,
depending on your application.

>
>3)  Am I correct in assuming that the file in question is called
>"_opengl.py"?
>
"import _opengl" will try to find _opengl.py, _opengl.pyc,
_openglmodule.so, and probably a few more variations that I am
forgetting.  _openglmodule.so is an "extension module" written in
C.

>4) is that _opengl_nummodule.so the numeric module for python?
>If so, why
>does "if OpenGL._numeric:" fail in the file
>"/usr/lib/python1.5/site-packages/OpenGL/GL/__init__.py"?

_opengl_nummodule.so is not the numeric module for python, but
(speculation alert- haven't looked at source) is rather is a
helper for PyOpenGL that uses the Numeric module.  OpenGL can use
Numeric for to help speed things up.

Hope this helps.

Patrick Lewis





* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!




More information about the Python-list mailing list