Download Pygame
Pygame is distributed as a Python package, so you install it with pip rather than downloading an installer. Here are the current versions, supported systems and the exact commands.
On this page
| pygame | pygame-ce | |
|---|---|---|
| Latest version | 2.6.1 | 2.5.8 |
| Released | ||
| Install command | pip install pygame | pip install pygame-ce |
| Prebuilt wheels for Python | 3.6 – 3.13 | 3.10 – 3.14 |
| Minimum Python (package metadata) | >=3.6 | >=3.10 |
| Wheels for | Windows (32-bit, 64-bit); macOS (Intel, Apple silicon); Linux (x86_64, aarch64, i686) | Windows (32-bit, 64-bit, ARM64); macOS (universal2); Linux (x86_64, aarch64, i686) |
| License | LGPL-2.1 | LGPL-2.1 |
| Official page | pygame on PyPI | pygame-ce on PyPI |
Checked against PyPI on November 28, 2026. The browser editor uses pygame-ce 2.4.1 on Python 3.12 (Pyodide 0.27.7).
The one command you need#
python -m pip install pygamePrefer the community edition? Install it instead (not both):
python -m pip install pygame-cePygame isn't a program you download and double-click. It's a library for Python, published on the Python Package Index (PyPI), and pip, the installer that comes with Python, downloads the right prebuilt package ("wheel") for your system automatically. There is no official standalone .exe or .dmg installer, so be wary of sites offering one.
Requirements#
- Python 3: get it from python.org. Choose a version that has prebuilt Pygame wheels (see the table above); brand-new Python releases can take a while to be supported by pygame.
- pip: included with Python. Check with
python -m pip --version. - An operating system with prebuilt wheels: Windows, macOS or Linux on common processors. Elsewhere pip has to compile from source, which needs a C compiler and SDL development libraries.
Install step by step#
Choose your system for detailed instructions, including PATH problems and permissions:
Use a virtual environment#
A virtual environment keeps each project's packages separate, avoids permission errors and is required by some Linux distributions:
python -m venv .venv
# Windows:
.venv\Scripts\activate
# macOS and Linux:
source .venv/bin/activate
python -m pip install pygameWhile the environment is active, python and pip refer to the project's own copies. Run deactivate to leave it.
Check that it works#
python -c "import pygame; print(pygame.version.ver)"
python -m pygame.examples.aliensThe first command prints the installed version; the second opens a small example game that ships with Pygame.
Upgrade or uninstall#
python -m pip install --upgrade pygame
python -m pip uninstall pygameTo switch from pygame to pygame-ce, uninstall one before installing the other. Both provide the pygame module, and having both installed in one environment causes conflicts.
Common installation errors#
| Message | Likely cause and fix |
|---|---|
No module named pygame | Installed into a different Python than the one running your code. Fix it. |
'pip' is not recognized / command not found | Use python -m pip (or py -m pip on Windows). |
error: externally-managed-environment | Your Linux or Homebrew Python blocks system-wide installs. Use a virtual environment. |
Building wheel fails, mentions sdl2-config or compilers | No prebuilt wheel exists for your Python version. Use a supported Python, or try pygame-ce. Details. |
More in Pygame not installing.
Official sources#
Install Pygame only from these official locations:
- pygame: PyPI page, website, source code on GitHub
- pygame-ce: PyPI page, website, source code on GitHub
Pygame.net does not host or modify Pygame binaries; the commands above download them from PyPI.
License#
Pygame and pygame-ce are free and open source under the GNU Lesser General Public License version 2.1 (LGPL-2.1). You can use them in free and commercial games. If you distribute a modified version of the library itself, the LGPL's terms apply.