r/learnpython • • 5d ago

Issues related to setuptools while installing Pygame

I'm trying to install pygame on Python 3.15.2. I keep getting the following message:

ModuleNotFoundError: No module named 'setuptools._distutils.msvccompiler'

I've installed and updated buildconfig and setuptools. What am I missing?

2 Upvotes

7 comments sorted by

1

u/socal_nerdtastic 5d ago

pygame was abandoned. For modern python you need to install pygame-ce. (all your code remains the same as before)

1

u/mynameisbob01 5d ago

I see. Thanks!

1

u/BananaGrenade314 5d ago

Is it true? I didn't know

1

u/Diapolo10 I write code for a living -- https://github.com/Diapolo10 4d ago

To answer your question, pygame does not currently offer wheels for Python 3.15, so Python attempts to build it from source, but you don't have MSVC installed so it fails to compile.

1

u/kimiyah_Fremiot 4d ago

newer versions removed distutils completely and older C-based packages haven't all updated their build scripts to handle it when compiling from source. you'll save yourself a massive headache by just running your virtual environment on a slightly older stable release like 3.11 or 3.12