2

I just downloaded pygame 32-bit on a 32-bit macintosh pro. I opened IDLE and typed in import pygame in IDLE shell then click enter. Usually I've heard that it should just return but it gives me the error message.

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

Please help me!!!

1
  • Are you sure it is not a 64-bit machine? This error generally occurs when trying to use 32-bit pygame with 64-bit Python. If it's the default install of Python on a 64-bit Mac then this is likely the problem. Unless it is quite an old machine it would likely be 64-bit. Commented Feb 10, 2012 at 4:13

2 Answers 2

1

I can't say if this is a problem of 32/64 bits installation, but you can easily check which version you are running :

import struct; print( 8 * struct.calcsize("P"))
Sign up to request clarification or add additional context in comments.

1 Comment

I am having the same problem... however, I don't know how to fix this. I have python.org's 2.7.8 and python 3.4.1 installed.. but it finds 2.7.8 which shows the error..
0

I think it is because you typed py or python3 so it popped up >>> in your terminal so I would download it and do this: Make sure there is no >>> if there is the only solution I found was the restart the terminal First download it like this I will be using 3.9 for the version for example:

py -3.9 -m pip install pygame

then use this to check if it downloaded

py -3.9 -m pygame --version

Then open up IDLE - Python [VERSION] and then new file and type import pygame and this should work!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.