pyglet 2.1.9


pip install pyglet

  Latest version

Released: Sep 21, 2025

Project Links

Meta
Author: Alex Holkner & contributors
Requires Python: >=3.8

Classifiers

pypi rtd PyTest

logo_large.png

pyglet

pyglet is a cross-platform windowing and multimedia library for Python, intended for developing games and other visually rich applications. It supports Windowing, input event handling, Controllers & Joysticks, OpenGL graphics, loading images and videos, and playing sounds and music. pyglet works on Windows, OS X and Linux.

:exclamation: :exclamation: A major pyglet update has just been released (v2.1). This brings many new exciting features, but also some necessary breaking changes. If your game/application has suddenly stopped working, please read the migration section in the documentation The previous version of pyglet is tracked in the pyglet-2.0-maintenance branch. If you want to do a pull request for the previous release, please target the appropriate branch.

pyglet has an active developer and user community. If you find a bug or a problem with the documentation, please open an issue. Anyone is welcome to join our discord server where a lot of the development discussion is going on. It's also a great place to ask for help.

Some features of pyglet are:

  • No external dependencies or installation requirements. For most application and game requirements, pyglet needs nothing else besides Python, simplifying distribution and installation. It's easy to package and distribute your project with Nuitka or PyInstaller.
  • Take advantage of multiple windows and multi-monitor desktops. pyglet allows you to use multiple platform-native windows, and is fully aware of multi-monitor setups for use with fullscreen games.
  • Load images, sound, music and video in almost any format. pyglet can optionally use FFmpeg to play back audio formats such as MP3, OGG/Vorbis and WMA, and video formats such as MPEG2, H.264, H.265, WMV and Xvid. Without FFmpeg, pyglet contains built-in support for standard formats such as wav, png, bmp, and others.
  • pyglet is written entirely in pure Python, and makes use of the ctypes module to interface with system libraries. You can modify the codebase or make a contribution without any second language compilation steps or compiler setup. Despite being pure Python, pyglet has excellent performance thanks to advanced batching for drawing thousands of objects.
  • pyglet is provided under the BSD open-source license, allowing you to use it for both commercial and other open-source projects with very little restriction.

Requirements

pyglet runs under Python 3.8+. Being written in pure Python, it also works on other Python interpreters such as PyPy. Supported platforms are:

  • Windows 7 or later
  • Mac OS X 10.3 or later
  • Linux, with the following libraries (most recent distributions will have these in a default installation):
    • OpenGL and GLX
    • GDK 2.0+ or Pillow (required for loading images other than PNG and BMP)
    • OpenAL or Pulseaudio (required for playing audio)

As of pyglet 2.0, OpenGL 3.3+ is required.

To play a large variety of compressed audio and video files, pyglet can optionally take advantage of FFmpeg.

Installation

pyglet is installable from PyPI:

pip install --upgrade --user pyglet

Installation from source

If you're reading this README from a source distribution, you can install pyglet with:

pip install --upgrade --user .
# or
python setup.py install --user

You can also install the latest development version directly from Github:

pip install --upgrade --user https://github.com/pyglet/pyglet/archive/master.zip

For local development install pyglet in editable mode:

# with pip
pip install -e .
# with setup.py
python setup.py develop

There are no compilation steps during the installation; if you prefer, you can simply add this directory to your PYTHONPATH and use pyglet without installing it. You can also copy pyglet directly into your project folder.

Contributing

A good way to start contributing to a component of pyglet is by its documentation. When studying the code you are going to work with, also read the associated docs. If you don't understand the code with the help of the docs, it is a sign that the docs should be improved. If you wish to make large changes to any part of pyglet, it's always a good idea to reach out for feedback first. This can avoid wasted effort in cases where someone is already working on something similar, or if your idea can't be accepted for any reason.

A basic outline of how to a contribution is as follows:

  • Fork the official repository.
  • In your fork, checkout the branch you wish to contribute to (such as pyglet-1.5-maintenance).
  • Apply your changes to your fork.
  • Submit a pull request describing the changes you have made.
  • Alternatively you can create a patch and submit it to the issue tracker.

When making a pull request, check that you have addressed its respective documentation, both within the code docstrings and the programming guide (if applicable). It is very important to all of us that the documentation matches the latest code and vice versa.

Consequently, an error in the documentation, either because it is hard to understand or because it doesn't match the code, is a bug that deserves to be reported on a ticket.

Building Docs

To get started quickly:

pip install -r doc/requirements.txt
python make.py docs

Please check Documentation and Type Hints guide to learn more.

Testing

pyglet makes use of pytest for its test suite.

pip install -r tests/requirements.txt --user
# Only run unittests
pytest tests/unit

Please check the testing section in the development guide for more information about running and writing tests.

Contact

pyglet is developed by many individual volunteers, and there is no central point of contact. If you have a question about developing with pyglet, or you wish to contribute, please join the discord server, or subreddit.

For legal issues, please contact Alex Holkner.

2.1.9 Sep 21, 2025
2.1.8 Aug 17, 2025
2.1.6 Apr 27, 2025
2.1.5 Apr 22, 2025
2.1.4 Apr 20, 2025
2.1.3 Feb 24, 2025
2.1.2 Jan 23, 2025
2.1.1 Jan 20, 2025
2.1.0 Jan 10, 2025
2.1rc3 Dec 30, 2024
2.1rc2 Dec 06, 2024
2.1rc1 Nov 05, 2024
2.1.dev7 Oct 12, 2024
2.1.dev6 Oct 03, 2024
2.1.dev5 Jul 20, 2024
2.1.dev4 Jul 13, 2024
2.1.dev3 Jul 02, 2024
2.1.dev2 Apr 13, 2024
2.1.dev1 Apr 02, 2024
2.0.21 Jan 10, 2025
2.0.20 Dec 06, 2024
2.0.19 Dec 04, 2024
2.0.18 Oct 08, 2024
2.0.17 Aug 07, 2024
2.0.16 Jul 13, 2024
2.0.15 Apr 03, 2024
2.0.14 Mar 08, 2024
2.0.13 Mar 08, 2024
2.0.12 Feb 29, 2024
2.0.11 Feb 28, 2024
2.0.10 Nov 07, 2023
2.0.9 Jul 29, 2023
2.0.8 Jun 22, 2023
2.0.7 May 09, 2023
2.0.6 May 02, 2023
2.0.5 Feb 28, 2023
2.0.4 Feb 01, 2023
2.0.3 Jan 02, 2023
2.0.2.1 Dec 19, 2022
2.0.2 Dec 19, 2022
2.0.1 Dec 02, 2022
2.0.0 Nov 01, 2022
2.0b3 Oct 31, 2022
2.0b2 Oct 23, 2022
2.0b1 Oct 12, 2022
2.0a4 Apr 19, 2022
2.0a3 Mar 31, 2022
2.0a2 Mar 25, 2022
2.0a1 Mar 25, 2022
2.0.dev23 Sep 15, 2022
2.0.dev22 Aug 11, 2022
2.0.dev21 Jul 27, 2022
2.0.dev20 Jun 28, 2022
2.0.dev19 Jun 22, 2022
2.0.dev18 Jun 02, 2022
2.0.dev17 Jun 02, 2022
2.0.dev16 May 18, 2022
2.0.dev15 May 16, 2022
2.0.dev14 Apr 19, 2022
2.0.dev13 Dec 23, 2021
2.0.dev12 Dec 15, 2021
2.0.dev11 Nov 02, 2021
2.0.dev10 Oct 31, 2021
2.0.dev9 Sep 21, 2021
2.0.dev8 Sep 14, 2021
2.0.dev7 Aug 28, 2021
2.0.dev6 Aug 20, 2021
2.0.dev5 Jun 03, 2021
2.0.dev4 Jun 02, 2021
2.0.dev3 May 21, 2021
2.0.dev2 Apr 24, 2021
2.0.dev1 Feb 09, 2021
2.0.dev0 Oct 21, 2019
1.5.31 Dec 24, 2024
1.5.30 Dec 10, 2024
1.5.29 May 13, 2024
1.5.28 Oct 23, 2023
1.5.27 Sep 21, 2022
1.5.26 May 20, 2022
1.5.24 May 12, 2022
1.5.23 Mar 21, 2022
1.5.22 Mar 02, 2022
1.5.21 Sep 16, 2021
1.5.20 Sep 08, 2021
1.5.19 Aug 18, 2021
1.5.18 Jun 23, 2021
1.5.17 May 21, 2021
1.5.16 Apr 13, 2021
1.5.15 Feb 09, 2021
1.5.14 Dec 31, 2020
1.5.13 Dec 18, 2020
1.5.11 Nov 19, 2020
1.5.10 Nov 16, 2020
1.5.9 Nov 09, 2020
1.5.8 Oct 16, 2020
1.5.7 Jun 21, 2020
1.5.6 Jun 12, 2020
1.5.5 May 03, 2020
1.5.4 Apr 22, 2020
1.5.3 Apr 06, 2020
1.5.2 Mar 23, 2020
1.5.1 Mar 18, 2020
1.5.0 Feb 18, 2020
1.4.11 Apr 19, 2020
1.4.10 Jan 17, 2020
1.4.9 Jan 01, 2020
1.4.8 Nov 21, 2019
1.4.7 Nov 12, 2019
1.4.6 Oct 21, 2019
1.4.5 Oct 07, 2019
1.4.4 Sep 09, 2019
1.4.3 Sep 05, 2019
1.4.2 Aug 13, 2019
1.4.1 Jul 08, 2019
1.4.0 Jul 05, 2019
1.4.0b1 Sep 21, 2018
1.4.0a1 Nov 22, 2017
1.3.3 Nov 25, 2019
1.3.2 Apr 13, 2018
1.3.1 Feb 05, 2018
1.3.0 Nov 10, 2017
1.3.0rc2 Oct 31, 2017
1.3.0rc1 Aug 22, 2017
1.3.0b1 May 06, 2017
1.2.4 Sep 02, 2015
1.2.4b1 Aug 17, 2015
1.2.3 Jun 20, 2015
1.2.3b1 May 30, 2015
1.2.3a2 May 01, 2015
1.2.3a1 Mar 29, 2015
1.2.2 Mar 07, 2015
1.2.1 Feb 20, 2015
1.2.0 Feb 12, 2015
1.2.0rc3 Feb 06, 2015
1.2.0rc2 Feb 02, 2015
1.1.4 Jan 07, 2010
1.2.0rc2.1 Feb 02, 2015

Wheel compatibility matrix

Platform Python 3
any

Files in release

No dependencies