Best way to install pygame on OS X Lion?

2019-01-25 04:42发布

I tried to install pygame via pip but this fails. Based on my google searches, it sounds like easy_install also fails.

I also checked out: http://www.pygame.org/wiki/MacLionCompile but the solution is incomplete.

I'm running python 2.7.1 bundled with Lion.

Suggestions? Appreciate the help.

标签: python pygame
5条回答
神经病院院长
2楼-- · 2019-01-25 05:20

You could try the binary package for Lion, available on the pygame website.

It worked for me (OSX 10.7.1 with bundled Python 2.7.1)

查看更多
Ridiculous、
3楼-- · 2019-01-25 05:22

See the answer from this question: PyGame in a virtualenv on OS X with brew?

Essentially, the PyGame in PyPy hasn't been updated for a while. The version in the repository has updated build scripts that handle Pythonbrew, virtualenv and other utilities.

The pip command to use is:

pip install hg+http://bitbucket.org/pygame/pygame
查看更多
我想做一个坏孩纸
4楼-- · 2019-01-25 05:28

Just for the sake of anyone that googles this question, my lab has a wiki set up with instructions for installing Pygame with just about any configuration:

http://smash.psych.nyu.edu/labwiki/PyGameSetup

查看更多
劫难
5楼-- · 2019-01-25 05:33

I have been looking for this for myself and I stumbled upon this build that happens to work. I am using OSX 10.8.3 and python 2.7.

http://inside.catlin.edu/moodle/mod/resource/view.php?id=16736

查看更多
放荡不羁爱自由
6楼-- · 2019-01-25 05:37

I had good luck with macports:

  1. Install macports if you don't already have it: http://www.macports.org/
  2. Install python via macports: sudo port install python26. I typed in the command it said at the end to set it as my default python installation. If you don't, then in step 4 you'll have to run the app a different way.
  3. Install pygame: sudo port install py26-game
  4. Run your pygame app: python main.py
查看更多
登录 后发表回答