Blake was good enough to prod me abound getting PyOpenGL 3.x to run under py2exe'd applications. The problem is that even if you copy the .egg directory to the distribution directory the setuptools entry points don't get registered, so PyOpenGL can't find its array-handling mechanisms.
After lots of trial and error I just wound up adding "import pdb; pdb.set_trace()" to the script and playing with it until I found something that let me load up the OpenGL hierarchy.
As it turns out, all that's necessary is to add the .egg directories to sys.path (I spent hours trying to figure out where setuptools registers its handlers). In regular installations that registration is done by the easy_install.pth directory processed by the site.py script. .pth files aren't supported under py2exe, however, so you have to roll your own support when building a stand-along application.
To hack the proof-of-concept I just created a "site.py" module in the distribution directory that adds the PyOpenGL-3.0.0a5-py2.5.egg directory to the path. Importing OpenGL after an "import site" then results in a functional demo. The proper fix is probably having py2exe or py2app notice the presence of the eggs and copy them over; then at run-time it could scan the distribution directory for all .egg files and add them to the path.
Pingbacks are closed.