鱼C论坛

 找回密码
 立即注册
查看: 2422|回复: 1

[已解决]python3.12安装pygame报错

[复制链接]
发表于 2023-1-1 10:23:14 | 显示全部楼层 |阅读模式
20鱼币
报错信息:
  1. Collecting pygame
  2.   Using cached pygame-2.1.2.tar.gz (10.1 MB)
  3.   Preparing metadata (setup.py) ... error
  4.   error: subprocess-exited-with-error

  5.   × python setup.py egg_info did not run successfully.
  6.   │ exit code: 1
  7.   ╰─> [77 lines of output]


  8.       WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
  9.       Using WINDOWS configuration...

  10.       Traceback (most recent call last):
  11.         File "<string>", line 2, in <module>
  12.         File "<pip-setuptools-caller>", line 34, in <module>
  13.         File "C:\Users\asky5\AppData\Local\Temp\pip-install-hibwemxp\pygame_d12528e76efb488d902a9da116f2e868\setup.py", line 359, in <module>
  14.           buildconfig.config.main(AUTO_CONFIG)
  15.         File "C:\Users\asky5\AppData\Local\Temp\pip-install-hibwemxp\pygame_d12528e76efb488d902a9da116f2e868\buildconfig\config.py", line 225, in main
  16.           deps = CFG.main(**kwds)
  17.                  ^^^^^^^^^^^^^^^^
  18.         File "C:\Users\asky5\AppData\Local\Temp\pip-install-hibwemxp\pygame_d12528e76efb488d902a9da116f2e868\buildconfig\config_win.py", line 511, in main
  19.           return setup_prebuilt_sdl2(prebuilt_dir)
  20.                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  21.         File "C:\Users\asky5\AppData\Local\Temp\pip-install-hibwemxp\pygame_d12528e76efb488d902a9da116f2e868\buildconfig\config_win.py", line 471, in setup_prebuilt_sdl2
  22.           DEPS.configure()
  23.         File "C:\Users\asky5\AppData\Local\Temp\pip-install-hibwemxp\pygame_d12528e76efb488d902a9da116f2e868\buildconfig\config_win.py", line 336, in configure
  24.           from . import vstools
  25.         File "C:\Users\asky5\AppData\Local\Temp\pip-install-hibwemxp\pygame_d12528e76efb488d902a9da116f2e868\buildconfig\vstools.py", line 11, in <module>
  26.           compiler.initialize()
  27.         File "C:\Users\asky5\AppData\Local\Programs\Python\Python312\Lib\site-packages\setuptools\_distutils\msvc9compiler.py", line 403, in initialize
  28.           vc_env = query_vcvarsall(VERSION, plat_spec)
  29.                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  30.         File "C:\Users\asky5\AppData\Local\Programs\Python\Python312\Lib\site-packages\setuptools\_distutils\msvc9compiler.py", line 281, in query_vcvarsall
  31.           raise DistutilsPlatformError("Unable to find vcvarsall.bat")
  32.       distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat
  33.       Making dir :prebuilt_downloads:
  34.       Downloading... https://www.libsdl.org/release/SDL2-devel-2.0.18-VC.zip ed561079ec622b0bab5a9e02976f5d540b0622da
  35.       Unzipping :prebuilt_downloads\SDL2-devel-2.0.18-VC.zip:
  36.       Downloading... https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.5-VC.zip 137f86474691f4e12e76e07d58d5920c8d844d5b
  37.       Unzipping :prebuilt_downloads\SDL2_image-devel-2.0.5-VC.zip:
  38.       Downloading... https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-devel-2.0.15-VC.zip 1436df41ebc47ac36e02ec9bda5699e80ff9bd27
  39.       Unzipping :prebuilt_downloads\SDL2_ttf-devel-2.0.15-VC.zip:
  40.       Downloading... https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-devel-2.0.4-VC.zip 9097148f4529cf19f805ccd007618dec280f0ecc
  41.       Unzipping :prebuilt_downloads\SDL2_mixer-devel-2.0.4-VC.zip:
  42.       Downloading... https://www.pygame.org/ftp/jpegsr9d.zip ed10aa2b5a0fcfe74f8a6f7611aeb346b06a1f99
  43.       Unzipping :prebuilt_downloads\jpegsr9d.zip:
  44.       Downloading... https://pygame.org/ftp/prebuilt-x64-pygame-1.9.2-20150922.zip 3a5af3427b3aa13a0aaf5c4cb08daaed341613ed
  45.       Unzipping :prebuilt_downloads\prebuilt-x64-pygame-1.9.2-20150922.zip:
  46.       copying into .\prebuilt-x64
  47.       Path for SDL: prebuilt-x64\SDL2-2.0.18
  48.       ...Library directory for SDL: prebuilt-x64/SDL2-2.0.18/lib/x64
  49.       ...Include directory for SDL: prebuilt-x64/SDL2-2.0.18/include
  50.       Path for FONT: prebuilt-x64\SDL2_ttf-2.0.15
  51.       ...Library directory for FONT: prebuilt-x64/SDL2_ttf-2.0.15/lib/x64
  52.       ...Include directory for FONT: prebuilt-x64/SDL2_ttf-2.0.15/include
  53.       Path for IMAGE: prebuilt-x64\SDL2_image-2.0.5
  54.       ...Library directory for IMAGE: prebuilt-x64/SDL2_image-2.0.5/lib/x64
  55.       ...Include directory for IMAGE: prebuilt-x64/SDL2_image-2.0.5/include
  56.       Path for MIXER: prebuilt-x64\SDL2_mixer-2.0.4
  57.       ...Library directory for MIXER: prebuilt-x64/SDL2_mixer-2.0.4/lib/x64
  58.       ...Include directory for MIXER: prebuilt-x64/SDL2_mixer-2.0.4/include
  59.       Path for PORTMIDI: prebuilt-x64
  60.       ...Library directory for PORTMIDI: prebuilt-x64/lib
  61.       ...Include directory for PORTMIDI: prebuilt-x64/include
  62.       DLL for SDL2: prebuilt-x64/SDL2-2.0.18/lib/x64/SDL2.dll
  63.       DLL for SDL2_ttf: prebuilt-x64/SDL2_ttf-2.0.15/lib/x64/SDL2_ttf.dll
  64.       DLL for SDL2_image: prebuilt-x64/SDL2_image-2.0.5/lib/x64/SDL2_image.dll
  65.       DLL for SDL2_mixer: prebuilt-x64/SDL2_mixer-2.0.4/lib/x64/SDL2_mixer.dll
  66.       DLL for portmidi: prebuilt-x64/lib/portmidi.dll
  67.       Path for FREETYPE not found.
  68.       ...Found include dir but no library dir in prebuilt-x64.
  69.       Path for PNG not found.
  70.       ...Found include dir but no library dir in prebuilt-x64.
  71.       Path for JPEG not found.
  72.       ...Found include dir but no library dir in prebuilt-x64.
  73.       DLL for freetype: prebuilt-x64/SDL2_ttf-2.0.15/lib/x64/libfreetype-6.dll

  74.       ---
  75.       For help with compilation see:
  76.           https://www.pygame.org/wiki/CompileWindows
  77.       To contribute to pygame development see:
  78.           https://www.pygame.org/contribute.html
  79.       ---

  80.       [end of output]

  81.   note: This error originates from a subprocess, and is likely not a problem with pip.
  82. error: metadata-generation-failed

  83. × Encountered error while generating package metadata.
  84. ╰─> See above for output.

  85. note: This is an issue with the package mentioned above, not pip.
  86. hint: See above for details.
复制代码

重新试过很多遍,但是都是报一样的错。急,在线等
最佳答案
2023-1-1 10:23:15
python3.12不兼容pygame2.1.2,官网现在也只更新到pygame2.1.2,还没有推出兼容python3.12的版本,再耐心等一等吧。

最佳答案

查看完整内容

python3.12不兼容pygame2.1.2,官网现在也只更新到pygame2.1.2,还没有推出兼容python3.12的版本,再耐心等一等吧。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2023-1-1 10:23:15 | 显示全部楼层    本楼为最佳答案   
python3.12不兼容pygame2.1.2,官网现在也只更新到pygame2.1.2,还没有推出兼容python3.12的版本,再耐心等一等吧。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-5-22 06:04

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表