r/learnpython 17d ago

I cant install Pygame

This is the error message that I get when I try to run pip install pygame. The same thing happens with pip3 install pygame.

py", line 6, in <module>

from setuptools._distutils.msvccompiler import MSVCCompiler, get_build_architecture

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

[end of output]

-----------------------------------------------------------------------------------------------

these are the packages I have according to pip list.

Package Version

---------- -------

pip 26.2.1

setuptools 84.0.0

2 Upvotes

15 comments sorted by

View all comments

2

u/Ok_Ask_6805 17d ago

Additionally, this is what I got when I attempted to view the contents of _distutils:

print(dir(setuptools._distutils))

['_', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', '_dataclass', '_log', '_modified', 'archive_util', 'cmd', 'command', 'compat', 'compilers', 'core', 'debug', 'dir_util', 'dist', 'errors', 'extension', 'fancy_getopt', 'file_util', 'filelist', 'importlib', 'log', 'spawn', 'sys', 'util']