我从pygame-1.9.1release-python.org-32bit-py2.7-macosx10.3.dmg
安装了pygame。我有 Python 2.7.6 和 OSX 10.9.2。由于某种原因,当我执行以下操作时,我收到 ImportError
:
>>> import pygame
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import pygame
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/__init__.py", line 95, in <module>
from pygame.base import *
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so, 2): no suitable image found. Did find:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so: no matching architecture in universal wrapper
如何让 pygame 工作?有没有办法获得 Python 3.4 的 pygame?我目前安装了 Python 2.7.6 和 Python 3.4。
最佳答案
也许尝试使用 Macports安装 pygame.您安装的软件包适用于使用 PowerPC 架构的 OSX 10.3 版本,而您运行的是使用 Intel 的 OSX 10.9。
关于Python pygame mac 导入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23692240/