Most users of PyOpenGL should use pip to install PyOpenGL automatically. It can be installed either to the system Python or a Virtualenv.
$ pip install PyOpenGL PyOpenGL_accelerate
If you cannot, or would prefer not to, use
you can download the package from the
PyOpenGL PyPI page.
The package uses Distribute
for its installation.
$ tar -zxvf PyOpenGL-3.0.2.tar.gz $ cd PyOpenGL-3.0.2 $ python setup.py install
If you would like the (optional) PyOpenGL-accelerate package, download it from the PyOpenGL_accelerate PyPI page and follow the same basic steps:
Note that you will require a working C compiler to compile the PyOpenGL-accelerate package. Pre-built packages are available for MS Windows 32 and MS Windows 64 users.
$ tar -zxvf PyOpenGL-accelerate-3.0.2.tar.gz $ cd PyOpenGL-accelerate-3.0.2 $ python setup.py install
Note that Togl support is deprecated, it's there for legacy code (once you compile Togl), but you should choose a GUI library that has OpenGL support built-in for any new development. Togl support has been dropped due to the complexity of compilation and the headache of maintenance. There are projects which attempt to provide Togl support, feel free to install those into your Python's Tk installation if you need Togl under Python.
Once you have the dependencies, you can install OpenGLContext itself
$ pip install PyDispatcher PyVRML97 OpenGLContext
Recommended Enhancements for OpenGLContext
If you would like to contribute to PyOpenGL development or just need to ride the bleeding edge, you will likely want to work with a source-code checkout. You will need the Bazaar (bzr) tool to work with the repository:
$ bzr branch lp:pyopengl $ cd pyopengl $ python setup.py develop --user $ cd OpenGL_accelerate $ python setup.py develop --user $ cd ../../
To contribute to OpenGLContext development (or to run the tests, for instance):
$ bzr branch lp:pyvrml97 $ cd pyvrml97 $ python setup.py develop --user $ cd ../ $ bzr branch lp:openglcontext $ cd openglcontext $ python setup.py develop --user
To contribute your changes back, either publish your branch publicly (for instance on LaunchPad) or create a "merge directive" to send to firstname.lastname@example.org:
bzr send -o my-changes.diff
Note that you'll need to subscribe to pyopengl-devel to post changes to it. If you prefer you can send them to Mike Fletcher instead.
The documentation build system is completely rewritten for PyOpenGL 3.x and is far easier to use and faster (at least a couple of orders of magnitude) than the old Java-based docbook processor.
bzr branch lp:~mcfletch/pyopengl/directdocs
The last command will not work unless you happen to be me. You need the lxml.etree and kid packages installed to run the generator (also bzr, svn, PyOpenGL, cvs, etceteras).