Trouble installing Pygame on Python 3.14

I have Python 3.14 and am using VSC v1.109.5 installed in my user directory on Windows Server 24H2 (OS Build 26100.32230). I had Copilot AI (part of VSC) write a screen saver, it chose to use Pygame. The screen saver will look like a night time with a silhouette of a city skyline where the square buildings have yellow windows that randomly turn off and on.

Last release of pygame was Sept 2024.

I have installed Visual Studio Build Tools 2022 and 2026 from Visual Studio & VS Code Downloads for Windows, Mac, Linux

I tried to install pygame with pip install pygame and got an error. The same error below.

I have upgraded setup tools with: pip install --upgrade setuptools pip wheel

I have tried to install pygame with pip install pygame --pre.

Here is the last part of the error I get from pip:

File "C:\users\MYUSER\AppData\Local\Temp\10\pip-install-vi8zffid\pygame_47e0c0364b7042e2b0b43a772dee942d\buildconfig\config_win.py", line 338, in configure
  from buildconfig import vstools
File "C:\users\MYUSER\AppData\Local\Temp\10\pip-install-vi8zffid\pygame_47e0c0364b7042e2b0b43a772dee942d\buildconfig\vstools.py", line 6, in <module>
  from setuptools._distutils.msvccompiler import MSVCCompiler, get_build_architecture
ModuleNotFoundError: No module named 'setuptools._distutils.msvccompiler'
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed to build 'pygame' when getting requirements to build wheel
  1. Is Pygame compatible with Python 3.14?
  2. What do I have to do to get Pygame installed and working?
  3. Or should I tell the AI to just not use Pygame?

Thank you!

Use pygame-ce instead of pygame. It’s a fork by most of the OG team; pygame is effectively unmaintained right now.

3 Likes

The sidebar for pygame indicates that it works on versions up to 3.12. Indeed, 3.13 was released in Oct 2024, after the last revision to pygame. They might have tried to patch it for the 3.13 release candidate, but not worth checking.

‘ce’ stands for ‘community edition’. It appears that the ‘pygame-ce’ distribution of pygame is installed as the ‘pygame’ package, so that ‘python -m pygame’ and ‘import pygame’ work unchanged. If so, you only need to change pip install commands.

Thanks for asking here so that others can find the answer.

1 Like

Thanks everyone for the great details!