installing python with idle & pygame

Discussion in 'Mac Programming' started by raylang, Jan 4, 2014.

  1. raylang macrumors newbie

    Jan 4, 2014
    Running OSX 10.9.1 on a Mac mini. I used Python 2.7.6 Mac OS X 64-bit/32-bit x86-64/i386 Installer, downloaded from, to install python with idle. I ran the Update Shell Profile.command in the Python 2.7 folder. Idle gives a warning on startup:

    >>> WARNING: The version of Tcl/Tk (8.5.9) in use may be unstable.
    Visit for current information.

    According to that, I needed Tcl/Tk 8.5.15 or later (I have no experience with that package) I downloaded ActiveTcl8. from ActiveState, but Idle gives the same error on startup.

    My goal is to learn python and pygame. I have successfully installed:

    I'm not a new programmer, but I am new to python and inexperienced at Mac installs that go beyond double-clicking a single install file or dragging an icon into a folder (in other words, I haven't done anything like a build from the command line), but evidently I'm missing a step here. I'm also new to these forums and appreciate any suggestions. Thanks for your patience with these newbie questions.
  2. balamw Moderator


    Staff Member

    Aug 16, 2005
    New England
  3. edwardIn macrumors newbie

    Aug 6, 2011
    Similar Python question

    I have a similar question about Python and Pygame. I downloaded and installed pygame, but when I run a script which includes "import pygame", I get an ImportError saying "No module named 'pygame.'"

    I'm running Python 3.3. I noticed on my hard drive I have a folder named 'Python.' In it are sub-folders named 2.3, 2.5, 2.6, and 2.7. The 2.7 folder has a folder named 'site-packages.' It has a 'pygame' folder in it. I wonder if the Python 3.3 I run does not look at the 2.7 folder for modules?

    Thank you for any assistance.

  4. ArtOfWarfare macrumors G3


    Nov 26, 2007
    Python 2 and 3 are incompatible with each other. You'll need to either use Python 2.7.6 to use your installed copy of PyGame, or find a version of PyGame for Python 3. I'm not sure what the end of life plan for Python 2 is, but I think they might be ending support for it before the end of 2014... Might cause problems, given a lot of the modules I use regularly haven't been updated for Python 3 yet...
  5. wrldwzrd89 macrumors G5


    Jun 6, 2003
    Solon, OH
    PyGame is obsolete now - PySDL2 is the recommended replacement. Note that you'll need to download SDL2, SDL2_image, SDL2_mixer, and SDL2_ttf separately - unlike Pygame, which bundles SDL.
  6. raylang thread starter macrumors newbie

    Jan 4, 2014
    Hi -- thanks for the reply. It did help, I'd seen the page earlier, but I grabbed ActiveTcl 8.6 instead of ActiveTcl, as instructed, thinking a later version would be fine. I now successfully have both Python 2.7.6 and 3.3.3 installed, both with Idle. Now, pygame 1.9.1 fails to import in either. It's supposed to be the version for Python 2.7.6, according to the download page, but it gives the following error:

    Python 2.7.6 (v2.7.6:3a1db0d2747e, Nov 10 2013, 00:42:54)
    [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
    Type "copyright", "credits" or "license()" for more information.
    >>> 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/", line 95, in <module>
    from pygame.base import *
    ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/, 2): no suitable image found. Did find:
    /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/ no matching architecture in universal wrapper

    As best I can interpret that, it means pygame is not installed correctly or completely. (to wrldwzrd89, for the moment, I need to move forward with pygame, but I certainly appreciate the notice that it's being replaced by pySDL2)

    In Python 3.3, I only get "ImportError: No module named 'pygame'"

    I tried the instructions shown on:

    but I got stuck on the 3rd-to-last step (damn!):
    /usr/local/share/python3/easy_install pip

    'easy_install' was not found, nor could I locate it in the file system.

    Thanks again for the help, and any more suggestions are welcome.

  7. ArtOfWarfare macrumors G3


    Nov 26, 2007
    I believe your problem in Python 2.7.6 is that you're running Python in 64 bit mode but only have a 32 bit version of PyGame. Or maybe it's the other way around. That's what having the wrong architecture would indicate to me.

    It's not going to work in Python 3. Period. Read my earlier post in this thread for more details if you don't understand.

Share This Page