Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation fails on Python 3.11.0 #3522

Closed
aza547 opened this issue Oct 27, 2022 · 37 comments
Closed

Installation fails on Python 3.11.0 #3522

aza547 opened this issue Oct 27, 2022 · 37 comments
Labels
bug Python 3.11 Issues required to support Python 3.11

Comments

@aza547
Copy link

aza547 commented Oct 27, 2022

Environment:

You can get some of this info from the text that pops up in the console when you run a pygame program.

  • Operating system (e.g. Windows, Linux(Debian), Linux(Ubuntu), Mac): Windows
  • Python version (e.g. 3.7.9, 3.8.5): 3.11.0
  • SDL version (e.g. SDL 2.0.12): Not sure
  • PyGame version (e.g. 2.0.0.dev10, 1.9.6): 2.1.2 (latest)
  • Relevant hardware (e.g. if reporting a bug about a controller, tell us the brand & name of it): N/A

Current behavior:
pip install pygame fails

Expected behavior:

above command succeeds

Steps to reproduce:

Please explain the steps required to duplicate the issue, especially if you are able to provide a sample application.
if the bug is caused by a specific file (image, font, sound, level, please upload it as an attachment

  1. Install python 3.11.0
  2. pip install pygame
  3. hit error above

Stack trace/error output/other error logs

pip install pygame
Collecting pygame
  Using cached pygame-2.1.2.tar.gz (10.1 MB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: pygame
  Building wheel for pygame (setup.py) ... error
  error: subprocess-exited-with-error
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [266 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-311
     e\examples
      copying examples\aacircle.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\aliens.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\arraydemo.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\audiocapture.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\blend_fill.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\blit_blends.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\camera.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\chimp.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\cursors.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\dropevent.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\eventlist.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\fonty.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\font_viewer.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\freetype_misc.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\glcube.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\headless_no_windows_needed.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\joystick.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\liquid.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\mask.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\midi.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\moveit.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\music_drop_fade.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\pixelarray.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\playmus.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\prevent_display_stretching.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\resizing_new.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\scaletest.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\scrap_clipboard.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\scroll.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\setmodescale.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\sound.py -> build\lib.win-amd64-cpython-311\pygame\examples
      copying examples\sound_array_demos.py -> build\lib.win-amd64-cpython-311\pygame\examples
 \src_c\mixer.cp311-win_amd64.lib and object build\temp.win-amd64-cpython-311\Release\src_c\mixer.cp311-win_amd64.exp
      Generating code
      Finished generating code
      building 'pygame.mixer_music' extension
      "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Iprebuilt-x64/SDL2-2.0.18/include -Iprebuilt-x64/SDL2_mixer-2.0.4/include -IC:\Users\EmptyCoder\AppData\Local\Programs\Python\Python311\include -IC:\Users\EmptyCoder\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcsrc_c/music.c /Fobuild\temp.win-amd64-cpython-311\Release\src_c/music.obj /GF /Gy
      music.c
      src_c/music.c(305): warning C4090: '=': different 'const' qualifiers
      src_c/music.c(377): warning C4133: 'return': incompatible types - from 'PyObject *' to 'Mix_Music *'
      "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:prebuilt-x64/SDL2-2.0.18/lib/x64 /LIBPATH:prebuilt-x64/SDL2_mixer-2.0.4/lib/x64 /LIBPATH:C:\Users\EmptyCoder\AppData\Local\Programs\Python\Python311\libs /LIBPATH:C:\Users\EmptyCoder\AppData\Local\Programs\Python\Python311 /LIBPATH:C:\Users\EmptyCoder\AppData\Local\Programs\Python\Python311\PCbuild\amd64 "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.19041.0\\um\x64" SDL2.lib SDL2_mixer.lib build\temp.win-amd64-cpython-311\Release\src_c/music.obj /OUT:build\lib.win-amd64-cpython-311\pygame\mixer_music.cp311-win_amd64.pyd /IMPLIB:build\temp.win-amd64-cpython-311\Release\src_c\mixer_music.cp311-win_amd64.lib
         Creating library build\temp.win-amd64-cpython-311\Release\src_c\mixer_music.cp311-win_amd64.lib and object build\temp.win-amd64-cpython-311\Release\src_c\mixer_music.cp311-win_amd64.exp
      Generating code
      Finished generating code
      building 'pygame.scrap' extension
      "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Iprebuilt-x64/SDL2-2.0.18/include -IC:\Users\EmptyCoder\AppData\Local\Programs\Python\Python311\include -IC:\Users\EmptyCoder\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcsrc_c/scrap.c /Fobuild\temp.win-amd64-cpython-311\Release\src_c/scrap.obj /GF /Gy
      scrap.c
      C:\Users\EmptyCoder\AppData\Local\Temp\pip-install-r1n_ydvm\pygame_cf0ae404ee27451c9319b21e52a59521\src_c\scrap_win.c(85): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
      C:\Users\EmptyCoder\AppData\Local\Temp\pip-install-r1n_ydvm\pygame_cf0ae404ee27451c9319b21e52a59521\src_c\scrap_win.c(97): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
      C:\Users\EmptyCoder\AppData\Local\Temp\pip-install-r1n_ydvm\pygame_cf0ae404ee27451c9319b21e52a59521\src_c\scrap_win.c(279): warning C4244: '=': conversion from 'SIZE_T' to 'unsigned long', possible loss of data
      src_c/scrap.c(294): warning C4244: 'function': conversion from 'Py_ssize_t' to 'int', possible loss of data
      "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:prebuilt-x64/SDL2-2.0.18/lib/x64 /LIBPATH:C:\Users\EmptyCoder\AppData\Local\Programs\Python\Python311\libs /LIBPATH:C:\Users\EmptyCoder\AppData\Local\Programs\Python\Python311 /LIBPATH:C:\Users\EmptyCoder\AppData\Local\Programs\Python\Python311\PCbuild\amd64 "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.19041.0\\um\x64" SDL2.lib user32.lib gdi32.lib build\temp.win-amd64-cpython-311\Release\src_c/scrap.obj /OUT:build\lib.win-amd64-cpython-311\pygame\scrap.cp311-win_amd64.pyd /IMPLIB:build\temp.win-amd64-cpython-311\Release\src_c\scrap.cp311-win_amd64.lib
         Creating library build\temp.win-amd64-cpython-311\Release\src_c\scrap.cp311-win_amd64.lib and object build\temp.win-amd64-cpython-311\Release\src_c\scrap.cp311-win_amd64.exp
      Generating code
      Finished generating code
      building 'pygame.pypm' extension
      "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Iprebuilt-x64/SDL2-2.0.18/include -Iprebuilt-x64/include -IC:\Users\EmptyCoder\AppData\Local\Programs\Python\Python311\include -IC:\Users\EmptyCoder\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcsrc_c/pypm.c /Fobuild\temp.win-amd64-cpython-311\Release\src_c/pypm.obj /GF /Gy
      pypm.c
      src_c/pypm.c(209): fatal error C1083: Cannot open include file: 'longintrepr.h': No such file or directory
      error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.33.31629\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      ---
      For help with compilation see:
          https://www.pygame.org/wiki/CompileWindows
      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: legacy-install-failure
× Encountered error while trying to install package.
╰─> pygame
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
@aza547 aza547 added the bug label Oct 27, 2022
@Matiiss
Copy link
Contributor

Matiiss commented Oct 27, 2022

This is not exactly a bug, it's that there are no release wheels yet for 3.11, use pip install pygame --pre (--pre stands for pre release), it will install pygame 2.1.3.dev8 and you can use that, 2.1.3 is coming soon but I can't tell for sure when.

@ghost
Copy link

ghost commented Nov 1, 2022

Was able to duplicate this issue with:

  • Python 3.11.0
  • macOS Monterey 12.6
  • Pygame 2.1.2
    I used pip3 install pygame and got a huge error message, as shown in the OP.

I do have a question, if there is no wheel made for Python3 3.11.0, is installing pygame 2.1.3.dev8 the only option? Is this release stable?

@Matiiss
Copy link
Contributor

Matiiss commented Nov 1, 2022

@arknaut Well, that's the latest version of pygame that has wheels for Python 3.11 so it would be the most stable for that version of Python. Also, yeah, it should be stable enough on its own anyways, but again, it's kind of temporary, I can't tell for sure (or at all) but soon wheels for 2.1.3 should be released and they will be made for 3.11 too.

@ghost
Copy link

ghost commented Nov 1, 2022

@Matiiss - Okay thanks! (just clarifying) pygame 2.1.3.dev8 has been released as a temporary version of pygame so that python 3.11.0 users can continue using pygame.

@Matiiss
Copy link
Contributor

Matiiss commented Nov 1, 2022

Uh, no, it's more like 2.1.3.dev8 (it's technically a pre-release btw) happens to have wheels for Python 3.11, it's not specifically temporarily released for 3.11 because really 2.1.3 is kind of released already, it just doesn't have wheels yet. But don't take my word for it, however, I'm pretty sure it's not something specifically done.

@ghost
Copy link

ghost commented Nov 1, 2022

@Matiiss - Okay got it, thanks!

@oddbookworm
Copy link
Contributor

2.1.3dev8 is the only version with 3.11 wheels prebuilt. If you really want to use 2.1.2, you'll have to build the wheels yourself. But 2.1.3dev8 is essentially the full 2.1.3 release, but in pre-release form. It wasn't specifically released to target 3.11, but since 3.11 was coming out soon, compatibility with 3.11 was added to dev8 by starbuck5 and ankith

@fladd
Copy link
Contributor

fladd commented Nov 3, 2022

Are there any updates on this? Or an ETA for the new Pygame version?

@MyreMylar
Copy link
Contributor

MyreMylar commented Nov 3, 2022 via email

@rammfire
Copy link

rammfire commented Nov 5, 2022

Hello everyone. I observe the same problem on Armbian

pip install pygame
Defaulting to user installation because normal site-packages is not writeable
Collecting pygame
  Downloading pygame-2.1.2.tar.gz (10.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.1/10.1 MB 3.5 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
  ╰─> [30 lines of output]
      
      
      WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
      Using UNIX configuration...
      
      /bin/sh: 1: sdl2-config: not found
      /bin/sh: 1: sdl2-config: not found
      /bin/sh: 1: sdl2-config: not found
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-m1yp62ur/pygame_44d4c02831ed4c49940d26d640b55b6a/setup.py", line 359, in <module>
          buildconfig.config.main(AUTO_CONFIG)
        File "/tmp/pip-install-m1yp62ur/pygame_44d4c02831ed4c49940d26d640b55b6a/buildconfig/config.py", line 225, in main
          deps = CFG.main(**kwds)
        File "/tmp/pip-install-m1yp62ur/pygame_44d4c02831ed4c49940d26d640b55b6a/buildconfig/config_unix.py", line 188, in main
          DependencyProg('SDL', 'SDL_CONFIG', 'sdl2-config', '2.0', ['sdl']),
        File "/tmp/pip-install-m1yp62ur/pygame_44d4c02831ed4c49940d26d640b55b6a/buildconfig/config_unix.py", line 39, in __init__
          self.ver = config[0].strip()
      IndexError: list index out of range
      
      Hunting dependencies...
      
      ---
      For help with compilation see:
          https://www.pygame.org/wiki/Compilation
      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.

@oddbookworm
Copy link
Contributor

oddbookworm commented Nov 5, 2022

@rammfire if you read a few messages above, Matiiss gave the solution

@Starbuck5 Starbuck5 pinned this issue Nov 5, 2022
@MyreMylar MyreMylar added the Python 3.11 Issues required to support Python 3.11 label Nov 6, 2022
@fladd
Copy link
Contributor

fladd commented Nov 11, 2022

@rammfire if you read a few messages above, Matiiss gave the solution

Unfortunately this is not really a solution for other packages that depend on Pygame.

For instance, I am about to release a new version of Expyriment, which depends on Pygame, and I am currently mainly holding it back due to this issue. Would be great to have some idea on when proper Python 3.11 support is planned (roughly, like within the next few days, or will it still be months?).

@oddbookworm
Copy link
Contributor

@fladd The full release of 2.1.3 is almost out. I'm hoping it'll be within a week or two at most, but that's really up to the discretion of the lead maintainer right now

@marios-pz
Copy link
Contributor

Cant wait for the full release ! 😄

@liudonghua123
Copy link

Though pip install pygame --pre works on python 3.11 on my windows 11. I would like to use the release version of pygame. 😄

Looking forward to pygame-2.1.3.

C:\Users\Liu.D.H>pip install pygame --pre
Collecting pygame
  Downloading pygame-2.1.3.dev8-cp311-cp311-win_amd64.whl (10.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.6/10.6 MB 4.8 MB/s eta 0:00:00
Installing collected packages: pygame
Successfully installed pygame-2.1.3.dev8

C:\Users\Liu.D.H>

@NikBandi
Copy link

NikBandi commented Dec 4, 2022

Thank you so much!!!

@AokiAhishatsu
Copy link

AokiAhishatsu commented Dec 5, 2022

C:\Users\Liu.D.H>pip install pygame --pre

Can confirm this works. (Tested on Win10)

@Ivoz
Copy link

Ivoz commented Dec 7, 2022

I would advocate for a point release that basically doesn't change anything from the previous, but simply provides wheels for the new python version. A lot of beginners will get caught up on this while a new patch release is prepared. e.g., 2.1.3 simply ships additional 3.11 wheels, 2.1.4 gets moved to new patch release.

@oddbookworm
Copy link
Contributor

I would advocate for a point release that basically doesn't change anything from the previous, but simply provides wheels for the new python version. A lot of beginners will get caught up on this while a new patch release is prepared. e.g., 2.1.3 simply ships additional 3.11 wheels, 2.1.4 gets moved to new patch release.

To the best of my knowledge, 2.1.3 is ready for release. Just waiting on the head maintainer to actually release it.

@fladd
Copy link
Contributor

fladd commented Dec 14, 2022

@fladd The full release of 2.1.3 is almost out. I'm hoping it'll be within a week or two at most, but that's really up to the discretion of the lead maintainer right now

Since it has been over a month now: Is there any news regarding the release?

@oddbookworm
Copy link
Contributor

Since it has been over a month now: Is there any news regarding the release?

To the best of my knowledge, the lead maintainer has not said anything to anyone in that time. Nobody else has the ability to release 2.1.3, so unfortunately we’re stuck waiting

@oddbookworm
Copy link
Contributor

@illume Python 3.11 has been out for a month and a half (and pygame's main branch has been on 2.1.4dev1 for just as long). More and more people are starting to move to 3.11 and the fact that the only version of pygame with support for 3.11 requires knowledge of how to install a prerelease might detract users from continuing to use pygame. Is there something specific holding back the release? There are also other projects that are waiting for pygame 2.1.3 to fully release so they can update their dependencies.

@ea7kir
Copy link

ea7kir commented Dec 17, 2022

I've tried and tried, but can't even instal the pre-release.
RPi 4B, Bullseye (64-bit), Python3.11.

pi@rxtouchlite:~/pgtest $ pip install pygame --pre
Collecting pygame
Downloading pygame-2.1.3.dev8.tar.gz (12.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.1/12.1 MB 2.8 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
╰─> [33 lines of output]

  WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
  Using UNIX configuration...
  
  /bin/sh: 1: sdl2-config: not found
  /bin/sh: 1: sdl2-config: not found
  /bin/sh: 1: sdl2-config: not found
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/tmp/pip-install-9_sp3ju8/pygame_06121d1e121e4eafb99504b0ad01a83b/setup.py", line 399, in <module>
      buildconfig.config.main(AUTO_CONFIG)
    File "/tmp/pip-install-9_sp3ju8/pygame_06121d1e121e4eafb99504b0ad01a83b/buildconfig/config.py", line 231, in main
      deps = CFG.main(**kwds, auto_config=auto)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-install-9_sp3ju8/pygame_06121d1e121e4eafb99504b0ad01a83b/buildconfig/config_unix.py", line 189, in main
      DependencyProg('SDL', 'SDL_CONFIG', 'sdl2-config', '2.0', ['sdl']),
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-install-9_sp3ju8/pygame_06121d1e121e4eafb99504b0ad01a83b/buildconfig/config_unix.py", line 39, in __init__
      self.ver = config[0].strip()
                 ~~~~~~^^^
  IndexError: list index out of range
  
  Hunting dependencies...
  
  ---
  For help with compilation see:
      https://www.pygame.org/wiki/Compilation
  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.

@MyreMylar
Copy link
Contributor

MyreMylar commented Dec 17, 2022 via email

@ea7kir
Copy link

ea7kir commented Dec 17, 2022

Are you sure you are using the pip from python 3.11 there? Pis come with multiple python versions. I thought you had to use pip3 on there

I think so. Both 'pip' and 'pip3' report version 22.3.1 from the same 'penv global 3.11.0'.

@MyreMylar
Copy link
Contributor

Ah, I suspect it is because the pi is looking on the piwheels repository instead of PyPI and it won't find any 3.11 wheels on piwheels because piwheels only builds wheels for a maximum of python 3.9.

If your pip is configured to use piwheels, but you want to use PyPI instead, you can remove or comment out the extra-index-url configuration in /etc/pip.conf

Otherwise you will have to learn to build pygame from source if you want to use 3.11 on a raspberry PI.

Trinkle23897 added a commit to Trinkle23897/envpool that referenced this issue Dec 28, 2022
@dlwaters
Copy link

Had same error. Used temporary fix.

Please, please, please post this solution on the homepage of Pygame!

I'm an experienced coder but new to python and spent several hours thinking I had done something wrong.

@oddbookworm
Copy link
Contributor

Unfortunately, the only person with access to the pygame.org website is the same person that can fix this whole mess in the first place. But, they’ve been unresponsive so far.

@dlwaters
Copy link

But, they’ve been unresponsive so far.

Bummer. First installs always seem to go sideways. :-(

@khalzal
Copy link

khalzal commented Feb 3, 2023

Hello, everybody.

I followed what was written here, but when I entered the "import pygame" command, I got an error (Windows can not find import).

Who can help? Where is my mistake? Which direction in should I look for a solution to the problem?

2023-02-03 161516
2023-02-03 161438

@oddbookworm
Copy link
Contributor

Did you try to run import pygame directly in command prompt? You need to be in an actual Python shell to do that (which you can get to just by typing python

@khalzal
Copy link

khalzal commented Feb 3, 2023

Did you try to run import pygame directly in command prompt? You need to be in an actual Python shell to do that (which you can get to just by typing python

Thank you! This little detail helped a lot.

@tayler6000
Copy link

tayler6000 commented Feb 6, 2023

I'm also trying to install from source at the moment and I'm getting the following error:

urllib.error.HTTPError: HTTP Error 503: Egress is over the account limit.

The pre-release wheel does work for me though.

@tute123456
Copy link

thx!

This is not exactly a bug, it's that there are no release wheels yet for 3.11, use pip install pygame --pre (--pre stands for pre release), it will install pygame 2.1.3.dev8 and you can use that, 2.1.3 is coming soon but I can't tell for sure when.

thx!

@notpygame notpygame unpinned this issue Feb 14, 2023
@g4b1nagy
Copy link

FYI: pygame 2.1.3 had just been released with support for Python 3.11. A bit thank you to the maintainers!

I think this can be closed.

@illume illume closed this as completed Feb 15, 2023
@liudonghua123
Copy link

Nice, I updated my pygame now.

C:\Users\Liu.D.H>pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -U pygame
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: pygame in c:\users\liu.d.h\appdata\local\programs\python\python311\lib\site-packages (2.1.3.dev8)
Collecting pygame
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/23/c4/64a649c9c9dc649c8c01d7f1027c0656155fc48ba17e6fdd2cb38a993610/pygame-2.1.3-cp311-cp311-win_amd64.whl (10.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.4/10.4 MB 6.4 MB/s eta 0:00:00
Installing collected packages: pygame
  Attempting uninstall: pygame
    Found existing installation: pygame 2.1.3.dev8
    Uninstalling pygame-2.1.3.dev8:
      Successfully uninstalled pygame-2.1.3.dev8
Successfully installed pygame-2.1.3

C:\Users\Liu.D.H>

@nandakoryaaa
Copy link

Failed to install pygame. There is an error in pypm compilation, saying "too many initializers".

building 'pygame.pypm' extension C:\usr\dev\msvs2022\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Iprebuilt-x64/SDL2-2.24.2/include -Iprebuilt-x64/include -Ic:\usr\dev\python\include -Ic:\usr\dev\python\Include -IC:\usr\dev\msvs2022\VC\Tools\MSVC\14.36.32532\include -IC:\usr\dev\msvs2022\VC\Tools\MSVC\14.36.32532\ATLMFC\include -IC:\usr\dev\msvs2022\VC\Auxiliary\VS\include "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" -IC:\usr\dev\msvs2022\VC\Tools\MSVC\14.36.32532\include -IC:\usr\dev\msvs2022\VC\Tools\MSVC\14.36.32532\ATLMFC\include -IC:\usr\dev\msvs2022\VC\Auxiliary\VS\include "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" -IC:\usr\dev\msvs2022\VC\Tools\MSVC\14.36.32532\include -IC:\usr\dev\msvs2022\VC\Tools\MSVC\14.36.32532\ATLMFC\include -IC:\usr\dev\msvs2022\VC\Auxiliary\VS\include "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcsrc_c/pypm.c /Fobuild\temp.win-amd64-pypy310\Release\src_c/pypm.obj /W3 /wd4142 /wd4996 /GF /Gy pypm.c src_c/pypm.c(3770): warning C4244: 'function': conversion from 'Py_ssize_t' to 'int32_t', possible loss of data
src_c/pypm.c(4767): warning C4113: 'PtTimestamp (__cdecl *)()' differs in parameter lists from 'PmTimeProcPtr'
src_c/pypm.c(6342): error C2078: too many initializers
src_c/pypm.c(6340): error C2078: too many initializers
src_c/pypm.c(6454): error C2078: too many initializers
src_c/pypm.c(6452): error C2078: too many initializers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Python 3.11 Issues required to support Python 3.11
Projects
None yet
Development

No branches or pull requests