ddin ~ %
python3 -m pygame.examples.aliens
报错如下:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 187, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 110, in _get_module_details
import(pkg_name)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pygame/init.py", line 83, in
from pygame.base import * # pylint: disable=wildcard-import; lgtm[py/polluting-import]
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pygame/base.cpython-310-darwin.so, 0x0002): tried: '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pygame/base.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))
python 3.8 需使用 pygame 2.0以上
试试
python3 -m pip install pygame==2.0.0.dev6