473,511 Members | 15,364 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 9972
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2055
by: Jonathan P. | last post by:
....that would be for desktop-based apps, games, 3d graphics, and multimedia. ....thanks to APIs and bindings like Pygame, PyOpenGL, PyGtk and PyGtkGLExt. A summary of a lengthy post on the...
12
2375
by: The Tao of Spike | last post by:
I've recentlty been getting into programming. I was wondering what language to learn first and after asking around I decided on Python. I'm about half way through "Non-Programmers Tutorial For...
9
4752
by: max(01)* | last post by:
hi there. i installed python2.3-opengl, then i tried one of those demos: ---- #!/usr/bin/python2.3 # This is statement is required by the build system to query build info if __name__ ==...
4
2208
by: Dave | last post by:
Hi. I am learning PyOpenGL and I am working with a largish fixed scene composed of several thousand GLtriangles. I plan to store the coords and normals in a NumPy array. Is this the fastest...
0
1288
by: Simon Bunker | last post by:
Hi I was wondering if there is a Python module for running GLSL (OpenGL shader language) in OpenGL through Python. I think that Cg is available through PyCg - most likely using PyGame for the...
3
2047
by: morris.slutsky | last post by:
So every now and then I like to mess around with hobby projects - I often end up trying to write an OpenGL video game. My last attempt aborted due to the difficulty of automating game elements and...
852
27942
by: Mark Tarver | last post by:
How do you compare Python to Lisp? What specific advantages do you think that one has over the other? Note I'm not a Python person and I have no axes to grind here. This is just a question for...
9
7493
by: Achim Domma | last post by:
Hi, I'm developing a GUI app in Python/C++ to visualize numerical results. Currently I'm using Python 2.4 with wx and PyOpenGLContext, but there are no windows binaries for Python 2.5 for quite...
1
4186
by: linksterman | last post by:
hey, I was experimenting with pyglet, and was trying out their opengl, but cant figure out how to scale images... #!/usr/bin/python # $Id:$ '''Demonstrates one way of fixing the display...
0
7242
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7353
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7075
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7508
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5662
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3212
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1572
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
446
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.