468,505 Members | 1,686 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,505 developers. It's quick & easy.

Beginner Python OpenGL difficulties

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.

May 28 '06 #1
3 9726
jg************@gmail.com wrote:
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

May 29 '06 #2

Mike C. Fletcher wrote:
jg************@gmail.com wrote:
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.

May 30 '06 #3
jg************@gmail.com wrote:

Mike C. Fletcher wrote:
jg************@gmail.com wrote:
> 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
May 30 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by The Tao of Spike | last post: by
9 posts views Thread by max(01)* | last post: by
4 posts views Thread by Dave | last post: by
reply views Thread by Simon Bunker | last post: by
852 posts views Thread by Mark Tarver | last post: by
9 posts views Thread by Achim Domma | last post: by
reply views Thread by NPC403 | last post: by
3 posts views Thread by gieforce | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.