The problem is that are you are using mingw Python.

Windows wheels (binaries) for Python packages are built with MSVC, because Python.org Python installs are built with MSVC. This ensures compatibility.

So since you have an unofficial version of Python it detects the incompatibility and sees that it has to build pygame from source.

The easiest way by far to get around this would be to use a standard Python installation instead. This doesn't mean you'd have to uninstall your existing Python, both could coexist. On Windows you can manage different versions of python with the py command. (py -0 lists, py -{version} executes that version).

There is some source support for MSYS2 stuff in the build configuration, but I have no idea how to use it. https://github.com/pygame-community/pygame-ce/commit/78b0574e493988878aafb37945f93c78ddc21a94 (I linked pygame-ce instead of pygame, since pygame-ce is the drop in fork of pygame I help maintain, and is more featureful)

Answer from Starbuck5 on Stack Overflow
🌐
GitHub
github.com β€Ί pygame β€Ί pygame β€Ί issues β€Ί 4712
ERROR: Failed to build 'pygame' when getting requirements to build wheel Β· Issue #4712 Β· pygame/pygame
January 1, 2026 - 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 import pygame pygame.init() print("Hello, world")
Author Β  pygame
🌐
Python.org
discuss.python.org β€Ί python help
Build wheel on pip - Python Help - Discussions on Python.org
November 30, 2025 - so when i use pip install pygame ... to fix this error here is the complete error: note: This error originates from a subprocess, and is likely not a problem with pip....
Discussions

python - Getting requirements to build wheel-error Pygame on Windows - Stack Overflow
I am trying to install Pygame using this: pip install pygame and I get this result: ` pip install pygame Collecting pygame Using cached pygame-2.4.0.tar.gz (13.2 MB) Installing build dependencies ... More on stackoverflow.com
🌐 stackoverflow.com
Installation fails on VS Code + Python 3.13.9 interpreter + Windows 11 PC
Hello, I was trying to pip install pygame for my final project, and after 2-3 days of troubleshooting, still can't. Can someone please help? I have tried several ideas suggested on the pygame w... More on github.com
🌐 github.com
5
November 9, 2025
(#solved) What am I doing wrong here?
Here I am trying to install PyGame 2.6.0 as per the instruction in the official website. I ran python3 -m pip install -U pygame==2.6.0 in an administrator instance of Windows Command Prompt. Howeve... More on github.com
🌐 github.com
3
October 21, 2025
Cannot install under Python 3.14
DLL for freetype: prebuilt-x64... 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... More on github.com
🌐 github.com
24
October 25, 2025
🌐
GitHub
github.com β€Ί pygame β€Ί pygame β€Ί issues β€Ί 4652
Installation fails on VS Code + Python 3.13.9 interpreter + Windows 11 PC Β· Issue #4652 Β· pygame/pygame
November 9, 2025 - I have tried several ideas suggested on the pygame website as well as youtube / google. Below is a quick summary of the issue: Since pygame cannot build a wheel, it tries to install from source.
Author Β  pygame
🌐
GitHub
github.com β€Ί pygame β€Ί pygame β€Ί issues β€Ί 4618
(#solved) What am I doing wrong here? Β· Issue #4618 Β· pygame/pygame
October 21, 2025 - I ran python3 -m pip install -U pygame==2.6.0 in an administrator instance of Windows Command Prompt. However, I am receiving the error: "error: subprocess-exited-with-error Getting requirements to build wheel did not run successfully." I'd like to know what I may be doing wrong.
Author Β  pygame
🌐
GitHub
github.com β€Ί pygame β€Ί pygame β€Ί issues β€Ί 4627
Cannot install under Python 3.14 Β· Issue #4627 Β· pygame/pygame
October 25, 2025 - Attempting to install pygame on Python 3.14.0 causes an error. It installs just fine on Python 3.13.9. ... PS C:\Windows\System32> py -3.14 -m pip install pygame Collecting pygame Using cached pygame-2.6.1.tar.gz (14.8 MB) Installing build dependencies ... done Getting requirements to build wheel ...
Author Β  pygame
🌐
GitHub
github.com β€Ί pygame β€Ί pygame β€Ί issues β€Ί 4476
python3 -m pip install -U pygame==2.6.0 Installation Issue Β· Issue #4476 Β· pygame/pygame
March 24, 2025 - --- For help with compilation see: https://www.pygame.org/wiki/MacCompile To contribute to pygame development see: https://www.pygame.org/contribute.html --- error: command '/usr/bin/clang' failed with exit code 1 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pygame Failed to build pygame ERROR: Failed to build installable wheels for some pyproject.toml based projects (pygame)
Author Β  pygame
Find elsewhere
🌐
Reddit
reddit.com β€Ί r/learnpython β€Ί can't install pygame
r/learnpython on Reddit: Can't install pygame
October 18, 2025 -

I'm completely new to python, and I watched a tutorial to install pygame, but I keep getting an error.

I have python downloaded and I'm in my command window, but when I run "pip install pygame", it spits out an error at "getting requirements to build wheel" that says "subprocess-exited-with-error". It's telling me that there's no setup file, and that the error originates from a subprocess and not pip. The error code is 1.

If anyone is able to help me figure this out I would be extremely grateful!

Edit: thank you all for your advice - I got it to work with pygame-ce!

🌐
Super User
superuser.com β€Ί questions β€Ί 939643 β€Ί trouble-installing-pygame-from-a-wheel-file
windows - Trouble installing pygame from a wheel file - Super User
You should consider upgrading via the 'pip install --upgrade pip' command. ... python -m pip install wheel python -m pip install C:/Users/your-username/Downloads/pygame-1.9.2a0-cp27-none-win_amd64.whl
🌐
YouTube
youtube.com β€Ί watch
pip install getting requirements to build wheel error - YouTube
Download this code from https://codegive.com Title: Resolving "Getting requirements to build wheel" Error with pip install - A Comprehensive GuideIntroductio...
Published Β  January 2, 2024
🌐
GitHub
github.com β€Ί pygame β€Ί pygame β€Ί issues β€Ί 4687
Can't install pygame via pip Β· Issue #4687 Β· pygame/pygame
December 10, 2025 - 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
Author Β  pygame
🌐
FreeBSD
forums.freebsd.org β€Ί ports and packages β€Ί installation and maintenance of ports or packages
I can't install pygamezero on python 3.11 using pip | The FreeBSD Forums
April 13, 2025 - Skipping Cython compilation --- For help with compilation see: [URL]https://www.pygame.org/wiki/Compilation[/URL] To contribute to pygame development see: [URL]https://www.pygame.org/contribute.html[/URL] --- error: command '/usr/bin/cc' failed with exit code 1 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pygame Failed to build pygame ERROR: Could not build wheels for pygame, which is required to install pyproject.toml-based projects.
🌐
Reddit
reddit.com β€Ί r/learnpython β€Ί trouble downloading pygame
r/learnpython on Reddit: Trouble Downloading Pygame
October 21, 2025 -

I'm a high school student trying to get more into coding outside of school, but I've been having an issue trying to download Pygame for about 6 hours. I've searched online forums and videos and frankly I'm stuck. If you have a solution or any ideas please make sure to explain it to me like I'm five years old.

(I inputed "pip install pygame" as well as tryed multiple different variations I found online.)

File "C:\Users\dault\AppData\Local\Temp\pip-install-fdldlyzz\pygame_fcbd9d39db4940a3b190f77fcb8a6ab7\buildconfig\config_win.py", line 338, in configure

from buildconfig import vstools

File "C:\Users\dault\AppData\Local\Temp\pip-install-fdldlyzz\pygame_fcbd9d39db4940a3b190f77fcb8a6ab7\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: subprocess-exited-with-error

Γ— Getting requirements to build wheel did not run successfully.

β”‚ exit code: 1

╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

🌐
Reddit
reddit.com β€Ί r/pygame β€Ί need help installing pygame
r/pygame on Reddit: Need help installing pygame
November 17, 2025 -

Hello, I've been trying to install pygame, but I keep getting an error about getting requirements to build wheel. From what I've read online, it seems pip is trying to install a deprecated library while installing pygame, but I haven't found any solutions to the problem anywhere on old posts about the same issue.

Here's what is displayed when I do "py -m pip install pygame" :

Collecting pygame

Using cached pygame-2.6.1.tar.gz (14.8 MB)

Installing build dependencies ... done

Getting requirements to build wheel ... error

error: subprocess-exited-with-error

Γ— Getting requirements to build wheel did not run successfully.

β”‚ exit code: 1

╰─> [112 lines of output]

Skipping Cython compilation

WARNING, No "Setup" File Exists, Running "buildconfig/config.py"

Using WINDOWS configuration...

Making dir :prebuilt_downloads:

Downloading... https://www.libsdl.org/release/SDL2-devel-2.28.4-VC.zip 25ef9d201ce3fd5f976c37dddedac36bd173975c

Unzipping :prebuilt_downloads\SDL2-devel-2.28.4-VC.zip:

Downloading... https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.5-VC.zip 137f86474691f4e12e76e07d58d5920c8d844d5b

Unzipping :prebuilt_downloads\SDL2_image-devel-2.0.5-VC.zip:

Downloading... https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.20.1/SDL2_ttf-devel-2.20.1-VC.zip 371606aceba450384428fd2852f73d2f6290b136

Unzipping :prebuilt_downloads\SDL2_ttf-devel-2.20.1-VC.zip:

Downloading... https://github.com/libsdl-org/SDL_mixer/releases/download/release-2.6.2/SDL2_mixer-devel-2.6.2-VC.zip 000e3ea8a50261d46dbd200fb450b93c59ed4482

Unzipping :prebuilt_downloads\SDL2_mixer-devel-2.6.2-VC.zip:

Downloading... https://github.com/pygame/pygame/releases/download/2.1.3.dev4/prebuilt-x64-pygame-2.1.4-20220319.zip 16b46596744ce9ef80e7e40fa72ddbafef1cf586

Unzipping :prebuilt_downloads\prebuilt-x64-pygame-2.1.4-20220319.zip:

copying into .\prebuilt-x64

Path for SDL: prebuilt-x64\SDL2-2.28.4

...Library directory for SDL: prebuilt-x64/SDL2-2.28.4/lib/x64

...Include directory for SDL: prebuilt-x64/SDL2-2.28.4/include

Path for FONT: prebuilt-x64\SDL2_ttf-2.20.1

...Library directory for FONT: prebuilt-x64/SDL2_ttf-2.20.1/lib/x64

...Include directory for FONT: prebuilt-x64/SDL2_ttf-2.20.1/include

Path for IMAGE: prebuilt-x64\SDL2_image-2.0.5

...Library directory for IMAGE: prebuilt-x64/SDL2_image-2.0.5/lib/x64

...Include directory for IMAGE: prebuilt-x64/SDL2_image-2.0.5/include

Path for MIXER: prebuilt-x64\SDL2_mixer-2.6.2

...Library directory for MIXER: prebuilt-x64/SDL2_mixer-2.6.2/lib/x64

...Include directory for MIXER: prebuilt-x64/SDL2_mixer-2.6.2/include

Path for PORTMIDI: prebuilt-x64

...Library directory for PORTMIDI: prebuilt-x64/lib

...Include directory for PORTMIDI: prebuilt-x64/include

DLL for SDL2: prebuilt-x64/SDL2-2.28.4/lib/x64/SDL2.dll

DLL for SDL2_ttf: prebuilt-x64/SDL2_ttf-2.20.1/lib/x64/SDL2_ttf.dll

DLL for SDL2_image: prebuilt-x64/SDL2_image-2.0.5/lib/x64/SDL2_image.dll

DLL for SDL2_mixer: prebuilt-x64/SDL2_mixer-2.6.2/lib/x64/SDL2_mixer.dll

DLL for portmidi: prebuilt-x64/lib/portmidi.dll

Path for FREETYPE: prebuilt-x64

...Library directory for FREETYPE: prebuilt-x64/lib

...Include directory for FREETYPE: prebuilt-x64/include

Path for PNG not found.

...Found include dir but no library dir in prebuilt-x64.

Path for JPEG not found.

...Found include dir but no library dir in prebuilt-x64.

DLL for freetype: prebuilt-x64/lib/freetype.dll

DLL for png: prebuilt-x64/SDL2_image-2.0.5/lib/x64/libpng16-16.dll

Traceback (most recent call last):

File "C:\Users\matro\AppData\Local\Temp\pip-install-1zhdeo_9\pygame_eb7a3368a9f3494ba92ebc290de71f20\buildconfig\vstools.py", line 4, in <module>

from distutils.msvccompiler import MSVCCompiler, get_build_architecture

ModuleNotFoundError: No module named 'distutils.msvccompiler'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "C:\Users\matro\AppData\Local\Temp\pip-install-1zhdeo_9\pygame_eb7a3368a9f3494ba92ebc290de71f20\buildconfig\config_win.py", line 336, in configure

from . import vstools

File "C:\Users\matro\AppData\Local\Temp\pip-install-1zhdeo_9\pygame_eb7a3368a9f3494ba92ebc290de71f20\buildconfig\vstools.py", line 6, in <module>

from setuptools._distutils.msvccompiler import MSVCCompiler, get_build_architecture

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

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "C:\Users\matro\AppData\Local\Temp\pip-install-1zhdeo_9\pygame_eb7a3368a9f3494ba92ebc290de71f20\buildconfig\vstools.py", line 4, in <module>

from distutils.msvccompiler import MSVCCompiler, get_build_architecture

ModuleNotFoundError: No module named 'distutils.msvccompiler'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "C:\Users\matro\AppData\Local\Programs\Python\Python314\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 389, in <module>

main()

~~~~^^

File "C:\Users\matro\AppData\Local\Programs\Python\Python314\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 373, in main

json_out["return_val"] = hook(**hook_input["kwargs"])

~~~~^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\matro\AppData\Local\Programs\Python\Python314\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 143, in get_requires_for_build_wheel

return hook(config_settings)

File "C:\Users\matro\AppData\Local\Temp\pip-build-env-kih6pz3u\overlay\Lib\site-packages\setuptools\build_meta.py", line 331, in get_requires_for_build_wheel

return self._get_build_requires(config_settings, requirements=[])

~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\matro\AppData\Local\Temp\pip-build-env-kih6pz3u\overlay\Lib\site-packages\setuptools\build_meta.py", line 301, in _get_build_requires

self.run_setup()

~~~~~~~~~~~~~~^^

File "C:\Users\matro\AppData\Local\Temp\pip-build-env-kih6pz3u\overlay\Lib\site-packages\setuptools\build_meta.py", line 512, in run_setup

super().run_setup(setup_script=setup_script)

~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\matro\AppData\Local\Temp\pip-build-env-kih6pz3u\overlay\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup

exec(code, locals())

~~~~^^^^^^^^^^^^^^^^

File "<string>", line 432, in <module>

File "C:\Users\matro\AppData\Local\Temp\pip-install-1zhdeo_9\pygame_eb7a3368a9f3494ba92ebc290de71f20\buildconfig\config.py", line 234, in main

deps = CFG.main(**kwds, auto_config=auto)

File "C:\Users\matro\AppData\Local\Temp\pip-install-1zhdeo_9\pygame_eb7a3368a9f3494ba92ebc290de71f20\buildconfig\config_win.py", line 493, in main

return setup_prebuilt_sdl2(prebuilt_dir)

File "C:\Users\matro\AppData\Local\Temp\pip-install-1zhdeo_9\pygame_eb7a3368a9f3494ba92ebc290de71f20\buildconfig\config_win.py", line 453, in setup_prebuilt_sdl2

DEPS.configure()

~~~~~~~~~~~~~~^^

File "C:\Users\matro\AppData\Local\Temp\pip-install-1zhdeo_9\pygame_eb7a3368a9f3494ba92ebc290de71f20\buildconfig\config_win.py", line 338, in configure

from buildconfig import vstools

File "C:\Users\matro\AppData\Local\Temp\pip-install-1zhdeo_9\pygame_eb7a3368a9f3494ba92ebc290de71f20\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

🌐
Python.org
discuss.python.org β€Ί python help
Trouble installing Pygame on Python 3.14 - Python Help - Discussions on Python.org
March 5, 2026 - 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 wil…
🌐
Reddit
reddit.com β€Ί r/pygame β€Ί pip install pygame error
r/pygame on Reddit: pip install pygame error
December 22, 2022 -

I'm trying to install pygame on my macbook pro but I keep running into errors. I've tried a few different things including pip install pygame --pre but that came up as command not found. I'm completely new to coding and don't really know what I'm doing so if someone could help me out that would be great. This is what comes up when I put in the code from pygame's site

Collecting pygame

Downloading pygame-2.1.2.tar.gz (10.1 MB)

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.1/10.1 MB 5.7 MB/s eta 0:00:00

Preparing metadata (setup.py) ... error

error: subprocess-exited-with-error

Γ— python setup.py egg_info did not run successfully.

β”‚ exit code: 1

╰─> [31 lines of output]

WARNING, No "Setup" File Exists, Running "buildconfig/config.py"

Using Darwin configuration...

/bin/sh: sdl2-config: command not found

/bin/sh: sdl2-config: command not found

/bin/sh: sdl2-config: command not found

Traceback (most recent call last):

File "<string>", line 2, in <module>

File "<pip-setuptools-caller>", line 34, in <module>

File "/private/var/folders/dc/svdtzmp910lf440sf2y2ckv80000gn/T/pip-install-eu2y9kle/pygame_e8033882705b411c88b6e8eca6af78ed/setup.py", line 359, in <module>

buildconfig.config.main(AUTO_CONFIG)

File "/private/var/folders/dc/svdtzmp910lf440sf2y2ckv80000gn/T/pip-install-eu2y9kle/pygame_e8033882705b411c88b6e8eca6af78ed/buildconfig/config.py", line 225, in main

deps = CFG.main(**kwds)

^^^^^^^^^^^^^^^^

File "/private/var/folders/dc/svdtzmp910lf440sf2y2ckv80000gn/T/pip-install-eu2y9kle/pygame_e8033882705b411c88b6e8eca6af78ed/buildconfig/config_darwin.py", line 132, in main

[DependencyProg('SDL', 'SDL_CONFIG', 'sdl2-config', '2.0', ['sdl'])],

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/private/var/folders/dc/svdtzmp910lf440sf2y2ckv80000gn/T/pip-install-eu2y9kle/pygame_e8033882705b411c88b6e8eca6af78ed/buildconfig/config_unix.py", line 39, in __init__

self.ver = config[0].strip()

~~~~~~^^^

IndexError: list index out of range

---

For help with compilation see:

https://www.pygame.org/wiki/MacCompile

To contribute to pygame development see:

https://www.pygame.org/contribute.html

---

[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

error: metadata-generation-failed

Γ— Encountered error while generating package metadata.

╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.

hint: See above for details.

🌐
Python.org
discuss.python.org β€Ί python help
Getting requirements to build wheel ... error - Python Help - Discussions on Python.org
November 29, 2023 - `Hi all, I was intending to install poliastro and followed the wiki page of them to install it properly. I am using Python 3.12 with latest pip installed. any solution? I am new here. This is my 1st post. Please corr…
🌐
TikTok
tiktok.com β€Ί discover β€Ί error-failed-to-build-pygame-when-getting-requirements-to-build-wheel
Error Failed to Build Pygame When Getting Requirements to Build Wheel | TikTok
May 18, 2026 - Facing issues with Pygame build failures? Learn how to troubleshoot errors and create engaging games with our expert tips!See more videos about Error En Gamehub Failed to Initialize Steam, Gamehub Error Failed to Initialize Player, Gamehub Error Failed to Find Steam, Failed to Initialize Graphics Gamehub, Aplication Launch Failed Gamehub, Gamehub Failed to Initialize Graphics.