PyOpenGL Installation

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

Manual Installation

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

Recommended Enhancements for PyOpenGL

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 Installation

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 (note that you must explicitly specify the OpenGLContext and PyVRML97 releases as they are not currently in final/production releases on PyPI):

$ virtualenv oglc-env
$ source oglc-env/bin/activate
(oglc-env)$ pip install PyOpenGL PyOpenGL_accelerate "PyVRML97==2.3.0a4" simpleparse numpy "OpenGLContext==2.2.0a3" pydispatcher pillow

Once you have the dependencies, you can install OpenGLContext itself

$ pip install PyDispatcher PyVRML97 OpenGLContext

Recommended Enhancements for OpenGLContext

BZR (Developer) Install

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 pyopengl-devel@lists.sourceforge.net:

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.

Building Documentation

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
cd directdocs
./samples.py
./references.py
./generate.py
./upload.py

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).