Macos Pygame Python 2.7 osx失败

Macos Pygame Python 2.7 osx失败,macos,python-2.7,pygame,Macos,Python 2.7,Pygame,我已经安装了。我正在运行Python 2.7.1,我通过以下操作确保安装了库: $ conda search pygame 并获得以下信息: pygame * 1.9.1 py27_1 quasiben 无论如何,当我尝试在一个.py程序中导入库时,会出现以下失败: ImportError: dlopen(/Users/usrname/anaconda/lib/python2.7/site-packages/py

我已经安装了。我正在运行Python 2.7.1,我通过以下操作确保安装了库:

$ conda search pygame
并获得以下信息:

pygame                    *  1.9.1                    py27_1  quasiben
无论如何,当我尝试在一个.py程序中导入库时,会出现以下失败:

ImportError: dlopen(/Users/usrname/anaconda/lib/python2.7/site-packages/pygame/base.so, 2): Library not loaded: /usr/local/lib/libSDL-1.2.0.dylib
Referenced from: /Users/usrname/anaconda/lib/python2.7/sitepackages/pygame/base.so
Reason: image not found

我的系统是El Capitan。

尝试卸载pygame并重新安装:


并确保您的pygame版本与python一起是最新的。

尝试卸载pygame并重新安装:


并确保您的pygame版本与python都是最新的。

看起来您缺少一个依赖项。尝试使用brew安装所有依赖项:

brew install sdl sdl_ttf sdl_image sdl_mixer portmidi

对如何在OS X上从头开始安装PyGame有很好的说明。

看起来您缺少一个依赖项。尝试使用brew安装所有依赖项:

brew install sdl sdl_ttf sdl_image sdl_mixer portmidi

关于如何在OS X上从头开始安装PyGame有很好的说明。

在XQuartz()最终完全适用于我之前,我也重新安装了它。在XQuartz()最终完全适用于我之前,我也重新安装了它。你找到答案了吗?你找到答案了吗?