简体   繁体   中英

Trying to install pygame on OSX 10.11 for python2

I'm running OSX 10.11 and have python 2.7.10 installed on my computer. I want to install pygame1.9.2 for the said environment (don't want to install it for python3 which is installed on my computer as well).

When I try to install this one - http://www.pygame.org/ftp/pygame-1.9.2pre-py2.7-macosx10.7.mpkg.zip - it says, "This package is incompatible with this version of OS X and may fail to install." Even if I continue, installation fails somehow.

I tried "pip install pygame" then it says

"Collecting pygame Could not find a version that satisfies the requirement pygame (from versions: ) No matching distribution found for pygame. "

How do I install it?

(for future reference) After spending many hours I found the following command to be working!

sudo pip install --user  git+https://github.com/pygame/pygame/

It's not 1.9.2 but can run what I wanted with python 2.7.10

>>> pygame.__version__
'2.0.0.dev0'

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