尝试了几乎所有你能在搜索中找到的方法。无法解决此错误。使用 pip3 安装了 pygame。
$ python3 -m pygame.examples.aliens
pygame 1.9.4
Hello from the pygame community. https://www.pygame.org/contribute.html
2019-03-26 00:52:36.610 Python[86073:400104] 00:52:36.609 WARNING: 140: This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support for this will be removed in a future release. Also, this makes the host incompatible with version 3 audio units. Please transition to the API's in AudioComponent.h.
Illegal instruction: 4
然后 Python 退出。
答案1
再次尝试,发现这里是:https://gist.github.com/connorshea/f539c91f210e72077ca9#gistcomment-2079353
Blockquote 此外,这些步骤都不再是必要的。这曾经是 OS X 的首选方法,但几个月前 Pygame 发行版进行了更新,现在您需要在所有平台上执行的操作如下:
pip install pygame