pip 安装 pygame库报错
xxxxx@xxx ~ % pip3 install pygameCollecting pygameUsing cached pygame-2.1.2.tar.gz (10.1 MB)Preparing metadata (setup.py) ... errorerror: subprocess-exited-with-error× python setup.py egg_info did not run successfully.│ exit code: 1╰─> 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/d6/91by9vm14zzbthyv2bxc6w9h0000gn/T/pip-install-9fxzjx5h/pygame_ab6a1c17b0ce4397b0cd85eea3da1c0f/setup.py", line 359, in <module> buildconfig.config.main(AUTO_CONFIG) File "/private/var/folders/d6/91by9vm14zzbthyv2bxc6w9h0000gn/T/pip-install-9fxzjx5h/pygame_ab6a1c17b0ce4397b0cd85eea3da1c0f/buildconfig/config.py", line 225, in main deps = CFG.main(**kwds) ^^^^^^^^^^^^^^^^ File "/private/var/folders/d6/91by9vm14zzbthyv2bxc6w9h0000gn/T/pip-install-9fxzjx5h/pygame_ab6a1c17b0ce4397b0cd85eea3da1c0f/buildconfig/config_darwin.py", line 132, in main )], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/d6/91by9vm14zzbthyv2bxc6w9h0000gn/T/pip-install-9fxzjx5h/pygame_ab6a1c17b0ce4397b0cd85eea3da1c0f/buildconfig/config_unix.py", line 39, in __init__ self.ver = config.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 --- 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新手 遇到这问题真的束手无策 baidu.com不解决问题
本帖最后由 wdscxsj 于 2022-12-2 15:49 编辑
如果是 Windows 系统,可以从这下载编译好的 .whl 版本:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame
Linux 系统(如 Ubuntu)可以安装系统源的发布包。其它系统(如 macOS)可能需要安装相关库并自行编译,也可以使用 Anaconda Mac 的包。具体参见 Pygame 文档(https://www.pygame.org/wiki/GettingStarted)。
wdscxsj 发表于 2022-12-2 15:43
如果是 Windows 系统,可以从这下载编译好的 .whl 版本:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#py ...
感谢 我这就去试下 谢谢,遇到了同样的问题
楼主是Python3.11吧 爱电脑的昕宇 发表于 2022-12-2 18:58
谢谢,遇到了同样的问题
楼主是Python3.11吧
是的hhhh 之前3.10就没这个问题 Ace_qingfeng 发表于 2022-12-2 18:02
感谢 我这就去试下
试一下用清华的镜像源 Kiring麒麟 发表于 2022-12-3 10:15
试一下用清华的镜像源
貌似不是源的问题吧 我有魔法 一般去官方repo找。
https://github.com/pygame/pygame/issues/3522
页:
[1]
2