How to Install pyglet in Python
pyglet is a cross-platform games and multimedia package.
pip install pyglet
What is pyglet?
pyglet is a cross-platform games and multimedia package.
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 branch. > If you want to do a pull request for the previous release, please target the appropriate branch.
pyglet [documentation] pyglet on [PyPI] pyglet [discord] server pyglet [mailing list] pyglet [issue tracker] pyglet [website]
Quick Start
Minimal example to get started with pyglet:
import pyglet
print(pyglet.__version__)
Installation
pip (standard)
pip install pyglet
Virtual environment (recommended)
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install pyglet
pip3
pip3 install pyglet
conda
conda install -c conda-forge pyglet
Poetry
poetry add pyglet
Verify the Installation
After installing, confirm the package is available:
python -c "import pyglet; print(pyglet.__version__)"
If this prints a version number, installation succeeded. If you see a ModuleNotFoundError, see the errors section below.
Installation Errors
Common errors when installing pyglet with pip.
ModuleNotFoundError: No module named 'pyglet'
Cause: The package is not installed in the current Python environment.
Fix: Run pip install pyglet. If using a virtual environment, ensure it is activated first.
ModuleNotFoundError: No module named 'pyglet' (installed but still failing)
Cause: pip installed the package into a different Python than the one running your script.
Fix: Use python -m pip install pyglet to install into the interpreter you are running.
ImportError: cannot import name 'X' from 'pyglet'
Cause: The function or class does not exist in the installed version.
Fix: Check the version with pip show pyglet and upgrade with pip install --upgrade pyglet.
pip: command not found
Cause: pip is not in PATH or Python was not added to PATH during installation.
Fix: Try python -m pip install pyglet. On macOS/Linux try pip3.
PermissionError: [Errno 13] Permission denied
Cause: No write access to the system Python package directory.
Fix: Use a virtual environment, or add --user: pip install --user pyglet
SSL: CERTIFICATE_VERIFY_FAILED
Cause: pip cannot verify PyPI's SSL certificate — common behind corporate proxies.
Fix: Try: pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org pyglet
Recent Releases
| Version | Released |
|---|---|
2.1.14 latest |
2026-04-05 |
3.0.dev2 |
2026-02-08 |
2.1.13 |
2026-02-04 |
2.1.12 |
2026-01-07 |
3.0.dev1 |
2025-12-12 |
Manage pyglet
Upgrade to latest version
pip install --upgrade pyglet
Install a specific version
pip install pyglet==2.1.14
Uninstall
pip uninstall pyglet
Check what is installed
pip show pyglet