After fiddling with the McMillian Installer
(http://www.mcmillan-inc.com/install5_intro.html) and
my little PyOpenGL client application, I found what was
causing the OpenGL import to fail -- the reading of the
"version" file in the root of the package.
If you are not familar with the McMillian Installer, it
effecitvely zips up all modules and packages your
application is dependent upon, and packs that
information to the tail end of an executable file. It
does this by detecting all imports and also has a
mechanism for adding modules manually. However, it
does not have a mechanism for detecting or including
standard files in the fashion that OpenGL/__init__.py
file is using. So therefore, it has trouble importing
OpenGL in the McMillian Installer, and thus my patch. :)
There are a few ways in which we can accomplish fixing
this problem.
1. We could hard code the version number in the
__init__.py (yuck! -- that's why there is a "version"
file in the first place)
2. We can do a try/except block around the reading of
the file. (what value does OpenGL.__version__ get when
this error occurs? If we set it to some default value,
this potentially changes the behavior of any version
dependent code in the application. This is
undersierable... I like things to work the same in or
out of the packaging.
3. We can rename "version" to "__version__.py", change
the syntax slightly, and change the "__init__.py" file
to deal with those new changes. (This allows packaging
implementations like Installer and cx_Freeze detect the
import and include it in the packaging.)
I like the 3rd option the best, and thereby have
created a patch to implement that feature.
Patch to OpenGL/init.py to use version.py
Logged In: YES
user_id=283742
Sorry, I could not figure out how to get the file to be in
the patch without adding it to cvs first... What's the
magic phrase? Anyhow, this file should complement the patch
by going into PyOpenGL2/OpenGL/__version__.py
Logged In: YES
user_id=727687
Originator: NO
This bug is fully outdated and can be safely closed. McMillan Installer is no more, and its successor (PyInstaller, http://www.pyinstaller.org\) does not have this problem since it contains a builtin workaround for PyOpenGL.