无法在mac上构建pyPortMidi

问题描述:

我已经在Mac OS x 10.5.8上从python.org安装了python-2.7-macosx10.5.dmg。无法在mac上构建pyPortMidi

我发出:蟒蛇setup.py建立pyPortMidi-0.0.3

并获得:

Found darwin (OS X) platform 
running build 
running build_ext 
pyrexc pypm.pyx --> pypm.c 
/Users/baz/Downloads/pyPortMidi-0.0.3/pypm.pyx:357:21: Type 'PmError' not acceptable as a boolean 
building 'pypm' extension 
creating build/temp.macosx-10.5-intel-2.7 
gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -O3 -arch i386 -arch x86_64 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pypm.c -o build/temp.macosx-10.5-intel-2.7/pypm.o 
pypm.c:1:2: error: #error Do not use this file, it is the result of a failed Pyrex compilation. 
pypm.c:1:2: error: #error Do not use this file, it is the result of a failed Pyrex compilation. 
lipo: can't figure out the architecture type of: /var/folders/oO/oO1flrWgHAC8u6KdoO0Wq++++TI/-Tmp-//ccTcgy0s.out 
error: command 'gcc-4.0' failed with exit status 1 

谁能帮我解决这个问题?

+0

看看这里的注意事项: http://cratel.wichita.edu/cratel/cratel%20pyportmidi#build_on_OS_X – 2012-03-08 14:04:59

我发现最简单的方法是构建包含在pygame中的pyPortMidi版本,该版本应用了一些修复程序。

您可以使用以下模式将它导入到您的文件顶部,更喜欢标准版本,但会回到pygame捆绑版本。

try: 
    import pypm 
except ImportError: 
    from pygame import pypm 

使用MacPorts的,很容易使用安装:

port install py27-game +portmidi 

我不知道,如果你需要一些特别的东西,包括在构建portmidi如果通过其他方法构建。

看看下面的链接,它似乎是东西是坏了,失踪。不知道他们是否会在短期内解决它......一直困扰着我过了一段时间...

https://groups.google.com/forum/#!topic/pygame-mirror-on-google-groups/sf3I8Q-wYQA