Installation
pyglet is a pure Python library, with no hard dependencies on other modules. No special steps or compilation are required for installation. You can install from on PyPI via pip. For example:
pip install --upgrade --user pyglet
You can also clone the repository using git and install from source:
git clone https://github.com/pyglet/pyglet.git
cd pyglet
python setup.py install --user
In addition, since pyglet is pure Python, you can also just copy the pyglet subfolder directly into the root of your project without installation into your local site-packages.
To play video, or a wide selection of compressed audio, pyglet can optionally use FFmpeg.
Python Version Support
pyglet aims to support all non-End-Of-Life (non-EOL) Python versions. Support isn’t necessarily dropped as soon as a Python version enters EOL, but support might be dropped, so it is best practice to use a non-EOL Python version when developing with pyglet.
To find out which versions of Python are currently supported and which are EOL you can reference the Status of Python Versions in the Python Developer’s Guide.
Running the examples
The source code archives include examples. Archive zip files are available on Github:
unzip pyglet-x.x.x.zip
cd pyglet-x.x.x
python examples/hello_world.py
As mentioned above, you can also clone the repository using Git:
git clone https://github.com/pyglet/pyglet.git
cd pyglet
python examples/hello_world.py