[英]Trouble installing Pygame on a Mac
我已经在Mac上安装了Python 2.7和Pygame,但是每次尝试“导入pygame”时,都会收到以下错误消息:
Traceback (most recent call last):
File "<pyshell#0>", 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
我究竟做错了什么?
这是一个典型的体系结构问题。 尝试一个
file /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so
如果结果行之一包含您的体系结构(例如i386),则问题不在于软件包本身,而在于您启动它的方式。 然后尝试从32位Python实例启动它:
python2.7-32
>>>import pygame
注意:您可以通过以下方式猜测您的架构
uname -m
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.