Menu

Pygame vs pygame-ce: Which One Should You Install?

pygame-ce is the community edition of pygame, a fork made by most of pygame's active developers. Both are imported as pygame and run the same code. Here is how they differ and which to install.

This page includes runnable editors. Edit, run, and see output instantly.

pygame-ce (pygame Community Edition) is a fork of pygame. In 2023 most of the people who were developing pygame moved their work to a new project they could run together, and published it on PyPI as pygame-ce. The original package, pygame, still exists.

For a learner the important part is that both are the same library to use: you write import pygame, and the same code runs on either.

The examples on these pages run on pygame-ce 2.5.

How they differ

pygamepygame-ce
Installpip install pygamepip install pygame-ce
Importimport pygameimport pygame
ReleasesLess oftenSeveral a year
Extra featuresFloat rects (pygame.FRect), key.get_just_pressed(), transform.scale_by(), text wrapping in Font.render(), pygame.Window, and more
Check in codegetattr(pygame, "IS_CE", False) is falsepygame.IS_CE is true
LicenseLGPLLGPL

Everything the original pygame offers is in pygame-ce, so code moves from pygame to pygame-ce with no changes. The other way is also fine as long as you do not use a pygame-ce addition.

Which should you install?

Install pygame-ce for new projects. It gets bug fixes and new Python versions sooner, and its additions save work: FRect stores positions as floats, so slow movement no longer gets lost to rounding (see Pygame Rect), and pygame.key.get_just_pressed() tells you which keys went down this frame.

Pick the original pygame only when a course, a book or a team asks for it. The skills are the same.

Installing and switching

The two packages both install a folder named pygame, so having both breaks the install. Keep exactly one:

python3 -m pip uninstall pygame pygame-ce
python3 -m pip install pygame-ce

How to install pygame covers the rest: checking the version, virtual environments and the common install errors.

Frequently Asked Questions

What is pygame-ce?

pygame Community Edition, a fork of pygame started in 2023 by most of the developers who were maintaining pygame at the time. It keeps the same API and the same import pygame, releases more often and adds new features.

Can I use pygame tutorials with pygame-ce?

Yes. pygame-ce runs almost all pygame code unchanged, so tutorials, books and answers written for pygame work with it.

How do I switch from pygame to pygame-ce?

Uninstall one, install the other: python3 -m pip uninstall pygame then python3 -m pip install pygame-ce. Your code does not change.

How can my code tell which one it runs on?

pygame-ce sets pygame.IS_CE. Check it with getattr(pygame, "IS_CE", False), which is false on the original pygame.

Coddy programming languages illustration

Learn to code with Coddy

Get started