[Tutor] Error message

RICHARD KENTISH r.kentish at btinternet.com
Sun Aug 10 14:30:01 CEST 2014


Thanks for your response. I have tried your suggestion and get the same error.  Here's the text from terminal.

Richards-MacBook-Pro:Python resources richardkentish$ pwd
/Users/richardkentish/desktop/Python resources
Richards-MacBook-Pro:Python resources richardkentish$ python blankgame.py
Traceback (most recent call last):
  File "blankgame.py", line 1, in <module>
    import pygame, sys
  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
Richards-MacBook-Pro:Python resources richardkentish$ 

I installed the python files from the python site, latest version for mac.

Best wishes,

Richard


________________________________
 From: Steven D'Aprano <steve at pearwood.info>
To: tutor at python.org 
Sent: Sunday, 10 August 2014, 12:30
Subject: Re: [Tutor] Error message
 

On Sun, Aug 10, 2014 at 10:32:52AM +0100, RICHARD KENTISH wrote:
> Hi!
> 
> Ive installed Python 2.7.8 and pygame 1.9.1 onto a macbook pro 10.9.4 Mavericks.
> 
> The code is taken direct from the 'making games' book. Here it is pasted from idle:

Whenever you have a mysterious error in Python that doesn't appear to be 
an error on your part -- and I admit that as a beginner, it's hard to 
tell which errors are yours and which aren't -- it's always worth trying 
again running Python directly. IDEs like IDLE sometimes do funny things 
to the environment in order to provide an Integrated Development 
Environment, and occasionally they can interfere with the clean running 
of Python code. So, just to be sure, I suggest you try running your code 
again outside of IDLE:

* Save your code to a file (which I see you've already done).

* Open up a terminal so you have a command line.

* Change into the directory where your file is saved. Type this command:

  cd "/Users/richardkentish/Desktop/Python resources"

  then press ENTER.

* Run the file directly using Python by typing this command:

  python blankgame.py

  then press ENTER.

If the error goes away, and you either get no error at all, or a 
different error, then it may be a problem with IDLE. Copy and paste the 
error here, and we can advise further.

Having said all that, looking at the exception you get:


> Traceback (most recent call last):
>   File "/Users/richardkentish/Desktop/Python resources/blankgame.py", line 1, in <module>
>     import pygame, sys
>   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

it looks to me like perhaps you have a version of Pygame which is not 
compatible with the Mac. How did you install it? I'm not a Mac expert 
(it's been about, oh, 17 years since I've used a Mac) but somebody else 
may be able to advise.


-- 
Steven
_______________________________________________
Tutor maillist  -  Tutor at python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20140810/4a2a05f8/attachment.html>


More information about the Tutor mailing list