無法在 iMac 12.6.3 Monterey 上安裝 pygame

無法在 iMac 12.6.3 Monterey 上安裝 pygame

我已關注https://brysonpayne.com/2015/01/10/setting-up-pygame-on-a-mac/

我還嘗試透過 python 終端機和 Mac 終端機安裝它,但我不斷收到以下錯誤訊息:

  Using cached pygame-2.1.2.tar.gz (10.1 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

× python setup.py Egg_info 未成功運作。 │ 退出碼: 1 ╰─> 【輸出34行】

  WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
  Using Darwin configuration...
  
  /bin/sh: pkg-config: command not found
  /bin/sh: pkg-config: command not found
  /bin/sh: pkg-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/82/gx_9dw5926nd_8h271w_4fp00000gn/T/pip-install-r0d2u6u4/pygame_7a53717a6a7b41a5a1e4d3f23d0f3159/setup.py", line 359, in <module>
      buildconfig.config.main(AUTO_CONFIG)
    File "/private/var/folders/82/gx_9dw5926nd_8h271w_4fp00000gn/T/pip-install-r0d2u6u4/pygame_7a53717a6a7b41a5a1e4d3f23d0f3159/buildconfig/config.py", line 225, in main
      deps = CFG.main(**kwds)
             ^^^^^^^^^^^^^^^^
    File "/private/var/folders/82/gx_9dw5926nd_8h271w_4fp00000gn/T/pip-install-r0d2u6u4/pygame_7a53717a6a7b41a5a1e4d3f23d0f3159/buildconfig/config_darwin.py", line 143, in main
      find_freetype(),
      ^^^^^^^^^^^^^^^
    File "/private/var/folders/82/gx_9dw5926nd_8h271w_4fp00000gn/T/pip-install-r0d2u6u4/pygame_7a53717a6a7b41a5a1e4d3f23d0f3159/buildconfig/config_darwin.py", line 110, in find_freetype
      pkg_config = DependencyProg(
                   ^^^^^^^^^^^^^^^
    File "/private/var/folders/82/gx_9dw5926nd_8h271w_4fp00000gn/T/pip-install-r0d2u6u4/pygame_7a53717a6a7b41a5a1e4d3f23d0f3159/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]

注意:此錯誤源自子進程,可能不是 pip 的問題。錯誤:元資料生成失敗

× 產生包元資料時遇到錯誤。 ╰─> 輸出見上文。

注意:這是上面提到的套件的問題,而不是 pip 的問題。提示:詳細資訊請參考上文。

我已經束手無策了。我需要做什麼才能加載 pygame。預先感謝您的幫助

相關內容