-2

***Update: Here are the errors I am getting:

>>> import pygame

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import pygame
  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

>>> arch -i386 /usr/bin/python2.7

SyntaxError: invalid syntax

>>> arch -i386 python2.7

SyntaxError: invalid syntax

>>> arch -i386 /usr/local/bin/python2.7

SyntaxError: invalid syntax

>>> arch -i386 python

SyntaxError: invalid syntax

If some of these are Unix commands that I should be entering somewhere else, please let me know.

I am trying to install pygame 1.9.1 (32bit) on 64 bit Mac 10.6 machine with Python 2.7.2 (I also have Python 3.2 installed on the same machine). I am using the Python versions downloaded from the website, not the preinstalled versions. I tried the following solutions (from here: How do I force Python to be 32-bit on Snow Leopard and other 32-bit/64-bit questions), but they didn't work for me:

export VERSIONER_PYTHON_PREFER_32_BIT=yes
arch -i386 /usr/bin/python2.6

(I also tried with renaming the last string python2.7 and just python)

I have entered all of these 'solutions' in the Python 2.7.2 shell. Please let me know if you have any other ideas and thanks so much for the help. I would appreciate if you could explain how to implement the solution in detail and what the solution does.

Community
  • 1
  • 1
Powers
  • 18,150
  • 10
  • 103
  • 108

1 Answers1

2

As noted in the comments of the answer you linked to, solution 1 only works with the Apple-supplied Pythons, not Pythons installed from elsewhere. The Apple-installed Pythons are accessed from /usr/bin; generally, Pythons installed from python.org or elsewhere will be accessible as just python2.7 (no /usr/bin) or possibly as /usr/local/bin/python2.7. Try solution 2 using one of those paths, i.e.:

arch -i386 python2.7
Ned Deily
  • 83,389
  • 16
  • 128
  • 151
  • Thanks for the comment. Should I run these commands in the Unix shell or the Python shell? Sorry, I am a newbie :) – Powers Jan 02 '12 at 01:08