skillfed

pyglet

pyglet is a cross-platform games and multimedia package.

pyglet v2.1.16 2.8M downloads/30d#2,875 on PyPI
License unclear Active released

What it is and what it does

pyglet is a pure-Python cross-platform library for building games and multimedia applications on Windows, macOS, and Linux. It handles windowing, OpenGL graphics rendering, input events (keyboard, mouse, joysticks), and multimedia playback (images, audio, video) without requiring external Python dependencies—only system libraries for audio and graphics on Linux. The library uses ctypes to interface with native platform libraries, allowing it to run on standard Python and PyPy without compilation steps.

Developers use pyglet to build 2D and 3D games, interactive visualizations, and multimedia applications. It supports multiple windows, multi-monitor setups, and fullscreen rendering. For audio and video, it can use FFmpeg for a wide range of compressed formats or rely on built-in support for standard formats like WAV and PNG. The library is actively maintained with an upcoming major version (3.0) that will add multiple rendering backends and WebGL support.

Use it for:

  • Build 2D or 3D games with OpenGL graphics and cross-platform input handling
  • Create interactive multimedia applications with audio and video playback
  • Develop fullscreen applications or games that span multiple monitors
  • Package and distribute Python games using tools like PyInstaller or Nuitka
  • Build visualizations or simulations requiring real-time graphics rendering

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

pyglet is a cross-platform windowing and multimedia library for Python that provides graphics, input handling, and audio/video playback for games and visually rich applications.

Yes, if you are building games or multimedia applications in Python and want a lightweight, dependency-free solution. The active maintenance, zero runtime dependencies, and cross-platform support make it a solid choice. However, verify the license terms for your use case, and be aware that version 3.0 is coming soon with potential API changes if you use OpenGL directly.

Install

pyglet on PyPI

pip

pip install pyglet

uv

uv add pyglet

poetry

poetry add pyglet

Installing pyglet

Before you install

Installation is straightforward with no external runtime dependencies beyond Python itself. The package is actively maintained with a recent release, and being pure Python with no compilation steps, it installs cleanly across platforms.

License in practice

License treatment is unclear from the metadata, though the description states pyglet is provided under the BSD open-source license allowing both commercial and open-source use. Verify the actual license terms before relying on this for commercial projects.

Quickstart

pip install pyglet

import pyglet
window = pyglet.window.Window()
pyglet.app.run()

Requires Python 3.8+. On Linux, system libraries (OpenGL/GLX, GDK 2.0+ or Pillow, OpenAL or Pulseaudio) must be installed. OpenGL 3.3+ is required as of pyglet 2.0.

Verify before relying

  • Exact scope of BSD license terms and any restrictions for specific use cases
  • Whether version 3.0 migration will require significant code changes for existing applications
  • Performance characteristics when rendering thousands of objects on different platforms

Package facts

License not declared (unclear)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 13 days since the last release
First released
Downloads 2,830,028/month — #2,875 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyglet-2.1.16-py3-none-any.whl

Tags

python game development librarycross-platform windowing graphicsopengl python multimediapython game engine lightweightaudio video playback pythoninput handling joystick controllerpure python graphics rendering
game-developmentmultimediagraphics-rendering

More Graphics packages