Windows
Python, the py launcher and pip on Windows 10 and 11.
Installing Pygame takes one pip command once Python is set up. Pick your operating system for step-by-step instructions and fixes for the usual snags.
Python, the py launcher and pip on Windows 10 and 11.
python.org or Homebrew Python, venv and pip on Macs.
pip in a venv, or your distribution's package.
python -m pip install pygame (use py on Windows or python3 on macOS and Linux if python isn't found).python -m pygame.examples.aliens.If anything goes wrong, the guides below explain each step for your system, and the troubleshooting section covers specific error messages.
Both install the same import pygame module and both work with every tutorial on this site. pygame-ce, the community edition, releases more often and usually supports new Python versions sooner. Install one or the other in a given environment, never both. Compare them.
School and work computers often block installations. Pygame Online runs Pygame code in your browser with nothing to install, and most beginner examples work there unchanged.