Beginner Python OpenGL difficulties

J

jg.campbell.ng

I'm beginning learning Python and OpenGL in Python.

Python fine. But difficulties with OpenGL; presumably with the
installation of OpenGL.

OS = Linux FC5.

Python program gl_test.py:

from OpenGL.GLUT import *
from OpenGL.GLU import *
from OpenGL.GL import *

name = "Hello, World"
height = 400
etc.

jc@localhost~/etc/python>$ python2 gl_test.py

Traceback (most recent call last):
File "gl_test.py", line 1, in ?
from OpenGL.GLUT import *
ImportError: No module named OpenGL.GLUT

jc@localhost~/etc/python>$ echo $PYTHONPATH
/usr/lib/python2.2/site-packages/OpenGL

jc@localhost/usr/lib/python2.2/site-packages/OpenGL>$ ll
total 1076
drwxr-xr-x 13 root root 4096 May 28 15:17 Demo/
drwxr-xr-x 3 root root 4096 May 28 15:17 doc/
drwxr-xr-x 25 root root 4096 May 28 15:17 GL/
-rwxr-xr-x 1 root root 624927 Jan 2 2005 GLE.so*
drwxr-xr-x 4 root root 4096 May 28 15:17 GLU/
-rwxr-xr-x 1 root root 312612 Jan 2 2005 GLUT.so*
drwxr-xr-x 6 root root 4096 May 28 15:17 GLX/
-rw-r--r-- 1 root root 868 Mar 12 2004 __init__.py
-rw-r--r-- 1 root root 1466 Jan 2 2005 __init__.pyc
etc ...

Any suggestions.

TIA,

Jon C.
 
M

Mike C. Fletcher

I'm beginning learning Python and OpenGL in Python.

Python fine. But difficulties with OpenGL; presumably with the
installation of OpenGL.

OS = Linux FC5.

Python program gl_test.py:

from OpenGL.GLUT import *
from OpenGL.GLU import *
from OpenGL.GL import *

name = "Hello, World"
height = 400
etc.

jc@localhost~/etc/python>$ python2 gl_test.py

Traceback (most recent call last):
File "gl_test.py", line 1, in ?
from OpenGL.GLUT import *
ImportError: No module named OpenGL.GLUT

jc@localhost~/etc/python>$ echo $PYTHONPATH
/usr/lib/python2.2/site-packages/OpenGL
You should already have site-packages in your PythonPath. You want the
directory *above* OpenGL in the path, not OpenGL itself. I'm unsure why
you're running a Python 2.2 instance on a modern Linux. I'd suspect
that you're using an RPM for an older Linux? Not sure there, I run
Gentoo, so everything builds from source for the packages that are
installed. There are some Fedora Core build patches in CVS that are
waiting for me to get my posterior in gear with Win32 testing to be
released. Not sure if that would change anything for you, though.

Good luck,
Mike

--
________________________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://www.vrplumber.com
http://blog.vrplumber.com
 
J

jg.campbell.ng

Mike said:
I'm beginning learning Python and OpenGL in Python.
[...]
ImportError: No module named OpenGL.GLUT

jc@localhost~/etc/python>$ echo $PYTHONPATH
/usr/lib/python2.2/site-packages/OpenGL
You should already have site-packages in your PythonPath. You want the
directory *above* OpenGL in the path, not OpenGL itself.

Yes, tried that:

$ echo $PYTHONPATH
/usr/lib/python2.2/site-packages/

and no improvement. Should there be a file or directory named GLUT* in
/usr/lib/python2.2/site-packages/OpenGL/ ? All I can see are GL, GLU
and GLX directories.

I'm unsure why
you're running a Python 2.2 instance on a modern Linux.

jc@localhost~/etc/python>$ python2
Python 2.4.2 (#1, Feb 12 2006, 03:59:46)
[GCC 4.1.0 20060210 (Red Hat 4.1.0-0.24)] on linux2

The OpenGL stuff was from an RPM that I sound on the web.

Many thanks,

Jon C.
 
D

Diez B. Roggisch

I'm beginning learning Python and OpenGL in Python.
[...]
ImportError: No module named OpenGL.GLUT

jc@localhost~/etc/python>$ echo $PYTHONPATH
/usr/lib/python2.2/site-packages/OpenGL
You should already have site-packages in your PythonPath. You want the
directory *above* OpenGL in the path, not OpenGL itself.

Yes, tried that:

$ echo $PYTHONPATH
/usr/lib/python2.2/site-packages/

and no improvement. Should there be a file or directory named GLUT* in
/usr/lib/python2.2/site-packages/OpenGL/ ? All I can see are GL, GLU
and GLX directories.

I'm unsure why
you're running a Python 2.2 instance on a modern Linux.

jc@localhost~/etc/python>$ python2
Python 2.4.2 (#1, Feb 12 2006, 03:59:46)
[GCC 4.1.0 20060210 (Red Hat 4.1.0-0.24)] on linux2

The OpenGL stuff was from an RPM that I sound on the web.

Go compile it yourself then - the RPM seems to be for python2.2, but you run
2.4. That means more happened than just changing the PYTHONPATH - so don't
expect you come away so cheap :)

Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top