Pythonのpygameのインストール時にエラーになり困っています。
インストールをするとターミナルに下記のエラーが出ました。
Collecting pygame==2.0.0
Using cached pygame-2.0.0.tar.gz (5.5 MB)
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/k3/y85mbtsx425_6dh7vqtgmgv00000gn/T/pip-install-vwvp_ddb/pygame_f039041c106b40a3b3b2a1a6d621b790/setup.py", line 318, in <module> buildconfig.config.main(AUTO_CONFIG) File "/private/var/folders/k3/y85mbtsx425_6dh7vqtgmgv00000gn/T/pip-install-vwvp_ddb/pygame_f039041c106b40a3b3b2a1a6d621b790/buildconfig/config.py", line 221, in main deps = CFG.main(**kwds) ^^^^^^^^^^^^^^^^ File "/private/var/folders/k3/y85mbtsx425_6dh7vqtgmgv00000gn/T/pip-install-vwvp_ddb/pygame_f039041c106b40a3b3b2a1a6d621b790/buildconfig/config_darwin.py", line 131, in main [DependencyProg('SDL', 'SDL_CONFIG', 'sdl2-config', '2.0', ['sdl'])], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/k3/y85mbtsx425_6dh7vqtgmgv00000gn/T/pip-install-vwvp_ddb/pygame_f039041c106b40a3b3b2a1a6d621b790/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.
調べてみると
”This error originates from a subprocess, and is likely not a problem with pip.”
→ このエラーはサブプロセスから発生しており、pipの問題ではない可能性が高いです。
”This is an issue with the package mentioned above, not pip.”
→ これは、pipではなく、上記のパッケージの問題です。
と出ていました。
これはインストールするパッケージ側の問題でユーザー側ではどうすることもできないエラーなのでしょうか?
/bin/sh: sdl2-config: command not found
でググっても参考になりそうな記事もなく、
下記サイトで書かれている方法も試しましたがうまくいきませんでした。
https://larch.at.webry.info/202010/article_2.html
どなたかご教示頂けると幸いです。
>そのpythonで下記を実行した結果を教えてください
print(platform.python_version())
→ 3.8.2
print(platform.platform())
→ macOS-13.0-x86_64-i386-64bit
