Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
Python, Lua and Tcl - public course schedule [here]
Private courses on your site - see [here]
Please ask about maintenance training for Perl, PHP, Java, C, C++, Ruby, MySQL and Linux / Tomcat systems
Game Programming with Python trouble

Posted by kudu (kudu), 23 October 2005

Whilst I realize the book's focus is on Windows, I'm trying to get the example programs running on my Linux box. I'm stumbling on the lack of WGL__init__.

Here's what I get:

>>> Running '/home/kudu/python/gpwp/chapter4/' ...
Traceback (most recent call last):
 File "/usr/lib/python2.4/site-packages/_spe/sm/", line 49, in run
   exec codeObject in mainDict
 File "<source>", line 49, in ?
 File "<source>", line 43, in run
 File "/usr/lib/python2.4/site-packages/pyui/", line 65, in init
   from renderers.openglPygame import OpenGLPygame
 File "/usr/lib/python2.4/site-packages/pyui/renderers/", line 25, in ?
   from pyui.renderers import openglBase
 File "/usr/lib/python2.4/site-packages/pyui/renderers/", line 49, in ?
   from OpenGL.WGL import wglUseFontBitmaps, wglGetCurrentDC
 File "/usr/lib/python2.4/site-packages/OpenGL/WGL/", line 2, in ?
   from WGL__init__ import *
ImportError: No module named WGL__init__
Exception raised while running script  <source>

Is there any way to get the example code running on my setup ??


Posted by admin (Graham Ellis), 25 October 2005
I'm on thin ice here, but it looks to me that this is a Windows Open GL call from within pyopengl.  In which case, your solution is likely to be a configuration change or different version of that module which calls the Linux / X windows equivalents. I see from the top page of the Pyopengl documentation that it builds on quite a range of lower level graphics drivers, of which WGL is but one.

Posted by kudu (kudu), 25 October 2005
Hi Graham,

Yes you're right. I got it sorted by hashing out the offending line that calls WGL __ini__, which has to do with loading Windows fonts if running in Windows OS. But since I'm not running on Windows and that module doesn't therefore exist it puked. Now it runs correctly.

Thank you for responding, very much appreciated.


This page is a thread posted to the opentalk forum at and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2018: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01225 708225 • FAX: 01225 793803 • EMAIL: • WEB: • SKYPE: wellho