Installing (and Building) PyOpenGL

This document describes the process of installing PyOpenGL 3.x.  PyOpenGL 3.x final releases use standard Python distutils.

Dependencies

PyOpenGL has a number of dependencies which need to be installed before installing PyOpenGL.  This list should point you to everything you need to get ready for running PyOpenGL:

Optional PyOpenGL Dependencies:

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 dependencies beyond PyOpenGL:

Optional, but generally useful OpenGLContext dependencies:

Standard Install (distutils (or setuptools))

PyOpenGL uses standard distutils.  You can download the source packages and install like so:

tar -zxvf PyOpenGL-3.0.0.tar.gz
cd PyOpenGL-3.0.0
python setup.py install

If you prefer to use easy_install, for instance within a virtualenv container, you will need to install setuptools (e.g. by running ez_setup.py), then run:

easy_install PyOpenGL

To update your install to the latest release of PyOpenGL with an easy_install based install:

easy_install -U PyOpenGL

If you want to install your Python egg files in a non-standard location be sure to setup your .pydistutils.cfg to support this before installing the packages.

You may want to uninstall any previous version of PyOpenGL before installing a new version, as there may be conflicts.

If you use setuptools to package your application, you should declare a dependency on "PyOpenGL" to pull in the latest PyOpenGL 3.x release.

Various PyOpenGL 3.0.0 alphas were dependent on setuptools.  This is no longer the case, as setuptools plugin mechanism was causing conflicts with platform packaging tools (py2exe, pyinstaller).

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 OpenGL-ctypes

You will need to put the "OpenGL" directory inside the OpenGL-ctypes directory created above on your PYTHONPATH for instance via a symlink or a .pth file.

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

Building Older Releases

If you would like to build the 2.x release of PyOpenGL, you can view the original installation documentation.