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
pip, you can
download the package from PyPI.
The package uses Setuptools for its installation.
$ tar -zxvf PyOpenGL-3.1.0.tar.gz $ cd PyOpenGL-3.1.0 $ 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.1.0.tar.gz $ cd PyOpenGL-accelerate-3.1.0 $ 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.
OpenGLContext is a very large package that depends on a large number of other packages to function. You do NOT need OpenGLContext to work with PyOpenGL.
Basic installation of OpenGLContext is as follows:
$ virtualenv oglc-env $ source oglc-env/bin/activate (oglc-env)$ pip install PyOpenGL PyOpenGL_accelerate PyVRML97 simpleparse numpy ttfquery fonttools OpenGLContext pydispatcher pillow
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 Git (git) tool to work with the repository:
$ git clone https://github.com/mcfletch/pyopengl.git $ cd pyopengl $ python setup.py develop --user $ cd accelerate $ python setup.py develop --user $ cd ../../
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.
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).