Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

JonnyAlpha

macrumors regular
Original poster
Oct 30, 2008
141
0
Hi;

I am learning Python for my Pi but I'm trying it out on my Mac.

Python 2.7.8 is installed by default but I also need Pygame, what version of Pygame do I need.
Can anyone point me to a guide for installing Pygame for Python 2.7.8.

I hav a Macbook Mid 2008 Mavericks 10.9.5

Thanks
 
Not sure about Pygame in particular, but the typical rule of thumb for getting anything Python installed is to install pip first, then type

Code:
pip install <name>

IE,

Code:
pip install pygame

In Python 3.2, pip became an official part of Python. It works for older versions too but isn't part of the official install.

Here's the directions for getting pip:
https://pip.pypa.io/en/latest/installing.html
 
Thanks
I tried pip previously but got an error, however after posting this I found this very useful guide on Youtube.

I did spot an error on the install of Pygame dependancies:

curl: (35) Server aborted the SSL handshake
Error: Failed to download resource "freetype"
Download failed: http://softlayer-dal.dl.sourceforge...es/freetype-2.5.3_1.mavericks.bottle.1.tar.gz
Warning: Bottle installation failed: building from source.


Should I run it again?

The guide also gave instructions to download and install Python Idle from the Python site to get an icon for the Dock?? I did this as well but when I enter import pygame at the prompt I get the following error:

Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import pygame
ImportError: No module named 'pygame'
 
Cannot Import Pygame

Hi;

I am trying to install Python and Pygame, I have installed them by following this guide.

Not sure why but it also says to install Python from the Python site.

Anyway now its installed whether I run Python from within the Terminal or from the Idle App when enter 'import pygame' and press return I get the following error:

import pygame
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import pygame
ImportError: No module named 'pygame'


Any idea how to resolve this?

Thanks

P.S. I am very new to Python and Pygame
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.