Error when Installing Pygame on Mountain Lion

a 夏天 提交于 2019-11-30 03:17:52

问题


I've been trying to get Pygame running on Mac OS X Mountain Lion and have had problems installing it. I have installed the following packages using homebrew:

  • sdl
  • sdl_image
  • sdl_mixer
  • sdl_ttf
  • smpeg

and when trying to compile Pygame (using the latest Mac OS X command line tools provided with Xcode 4.4) I get an error message stating the following:

src/scale_mmx64.c:499:27: error: invalid instruction mnemonic 'movsxl'

and I have no idea how to solve this issue. Pygame worked perfectly on Mac OS X Lion and this seems to have been caused either by the upgrade to the latest version of Xcode (which has removed GCC from the system) or the upgrade to Mountain Lion itself. I suspect the upgrade to Xcode is responsible but I am not sure.

Does anyone have any suggestions for fixing this issue at all?


回答1:


I was beating my head against the wall on the same thing. I'm still so irritated that I'm thinking about installing Linux on my MacBook Air, but we'll see.

I built it from source, after making the modification to source listed here: https://bitbucket.org/pygame/pygame/changeset/e296ada67fad

Basically, in src/scale_mmx64.c you need to replace the two occurrences of 'movsxl' with 'movslq'

If you're using homebrew, make sure root is setup to refer to your homebrew libs etc first. Still fixing that one now when I get the chance to work on it again. (Wasn't using SDL_image and choking on loading a PNG)




回答2:


Maybe this wont help you in your problem. But seeing that many people may find this post because they can't get pygame to install on Mountain Lion I will be posting a solution here:

First, I don't know why Apple's Python 2.7.2 version did not install the Python.framework bundle on the /Library/Frameworks directory. In order to fix that, you have to install the 2.7.3 version provided on python.org

Then you may reinstall pygame on your hard disk. The version I used is the pygame-1.9.1-for-32bit-python2.7

Now you are ready to go. Reopen Terminal and type python. You should see the python interpreter and at the top version 2.7.3

Because of the 32bit pygame restriction, I have to run my programs like this:

arch -i386 python main.py

Hope this helps other people.



来源:https://stackoverflow.com/questions/11954497/error-when-installing-pygame-on-mountain-lion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!