Beginner Python OpenGL difficulties

Mike C. Fletcher mcfletch at vrplumber.com
Mon May 29 23:50:54 CEST 2006


jg.campbell.ng at 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 at 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 at 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




More information about the Python-list mailing list