1
votes

First off, just like to say I'm running OS X 10.9

I'm having difficulty installing pygame. I have python version 2.7.8 and downloaded the pygame 1.9 for python 2.7 DMG.

I go through the installer and it seems as though I have successfully installed pygame. However, in my terminal, when I enter python and then try and enter the command import pygame to verify that pygame was installed, I get the following message (below)

I am quite new to python and have never used pygame before, but if someone could please explain to me how to install pygame, that would be great! I find the documentation on pygame's website a little confusing as to how to install.

Thanks in advance!

>>> import pygame
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/__init__.py", line 95, in <module>
    from pygame.base import *
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so, 2): no suitable image found.  Did find:
    /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so: no matching architecture in universal wrapper
1
Did you make sure to restart it your computer after installation? I think I was in the same situation as you were and that resolved my issue at the time. Could be worth a shot - Cocksure
@Cocksure I just tried that. Still run into the same situation - Evan Cooper
Try using brew - elyase
@elyase How so? I have homebrew installed, but how would I used it to install pygame - Evan Cooper
In my previous comment you will see a link with instructions. - elyase

1 Answers

1
votes

I highly recommend using a package manager such as homebrew to install Python / Pygame. It'll keep everything nice and organized for you.

Installing Pygame for Python 3 on OSX

This link has instructions for Python 3, not Python 2, but hopefully it helps.