简体   繁体   中英

Installing pygame with enthought canopy on Mac

I'm trying to install pygame in my enthought canopy python distribution. I'm using the latest version of canopy for 64-bit Mac (Python 2.7.6), and I'm using Mavericks OS. I know that installing pygame should be possible since I managed to get pygame working with the official python 2.7.6 from the python website using the binary installation file available here .

The first thing I tried was ensuring that canopy was my default python, and the installation file linked above, but this just re-installed pygame into the official python distribution.

Next I tried pip, which I've used to install other packages successfully (eg, spyder). The following is what happens when I try pip install pygame :

Downloading/unpacking pygame

Downloading pygame-1.9.2pre-py2.7-macosx10.7.mpkg.zip (7.4Mb): 7.4Mb

downloaded

Running setup.py egg_info for package pygame

 Traceback (most recent call last): File "<string>", line 14, in <module> IOError: [Errno 2] No such file or directory: '/Users/Sam/build/pygame/setup.py' Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 14, in <module> 

IOError: [Errno 2] No such file or directory: '/Users/Sam/build/pygame/setup.py'

This is different to the error reported here , so I'm not sure at all what's going on. Any suggestions?

On Yosemite and Canopy 64bit assuming you have homebrew, pygame installed fine with:

brew install sdl sdl_ttf sdl_image sdl_mixer
brew install hg
sudo pip install hg+http://bitbucket.org/pygame/pygame

I think I found a solution: I simply used pip to install pygame from a specific location, using sudo pip install hg+http://bitbucket.org/pygame/pygame . Unlcear why this worked, however.

You need to install a 32 bit version of Python. PyGame doesn't run on the 64 bit builds, and OSX ships with a 64 bit build. download from here python2.7.3 then download pygames

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM