Results 1 to 9 of 9
  1. #1


    Member Since
    Apr 05, 2012
    Location
    Brazil
    Posts
    6
    Specs:
    MacMini 2007 running OS X Lion || 2GB RAM || 120GB HDD || 2,2GHz
    Question Pygame won`t install on Mac OS X Lion
    Hey, i`m trying to install Pygame for fytoh 3.2.2 on a Mac Mini running OSX 10.7.3, and it keeps failing every single try. I`m using a tutorial from http://programming.itcarlow.ie/PyGameInstall.pdf and got every thing to work, but stuck at Step 7, to build the setup.py file.
    Code:
    viennamini:pygame Home$ python setup.py build
    running build
    running build_py
    running build_ext
    building 'pygame.imageext' extension
    /usr/bin/gcc-4.2 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -pipe -Ddarwin -I/Library/Frameworks/SDL.framework/Versions/Current/Headers -I/Library/Frameworks/SDL_image.framework/Versions/Current/Headers -I/usr/local/include -I/usr/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/imageext.c -o build/temp.macosx-10.7-intel-2.7/src/imageext.o
    In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:4,
                     from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85,
                     from src/pygame.h:75,
                     from src/imageext.c:47:
    /Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory
    error: command '/usr/bin/gcc-4.2' failed with exit status 1
    This is the output when I run build. I checked the /Developer folder and the stdarg.h file IS there, so I`m lost. Any ideas?

  2. #2

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,782
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    This doesn't answer your question directly but is there any reason that you're not using a pre-built binary (you can get them here)? That would save you a headache and some time.
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  3. #3


    Member Since
    Apr 05, 2012
    Location
    Brazil
    Posts
    6
    Specs:
    MacMini 2007 running OS X Lion || 2GB RAM || 120GB HDD || 2,2GHz
    Quote Originally Posted by vansmith View Post
    This doesn't answer your question directly but is there any reason that you're not using a pre-built binary (you can get them here)? That would save you a headache and some time.
    Well, thats the problem, they do not have binaries for Python 3.2 on Mac, just for the 2.x Python. So I tried to compile from the source, but, well, you saw the results.
    EDIT: I re-checked the stdarg.h file and it is re-directing the
    Code:
    #include_next <stdarg.h>
    to itself. Perhaps change it? Don't know what to do

  4. #4


    Member Since
    Apr 05, 2012
    Location
    Brazil
    Posts
    6
    Specs:
    MacMini 2007 running OS X Lion || 2GB RAM || 120GB HDD || 2,2GHz
    Unhappy New try
    OK, i tried something else. I used MacPorts to install Pygame. Clean and swift. Then I opened Terminal and tested, both with the default Python, 2.7, and the updated one, 3.2.
    For the 2.7 it went well. Imported with no errors and I actually managed to create a functional GUI.
    Code:
    viennamini:~ Home$ python
    Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) 
    [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import pygame
    >>>
    BUT, for the 3.2 version, I got an error:
    Code:
    viennamini:~ Home$ python3
    Python 3.2.2 (v3.2.2:137e45f15c0b, Sep  3 2011, 17:28:59) 
    [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import pygame
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/Library/Python/3.2/site-packages/pygame-1.9.1release-py2.7-macosx-10.7-intel.egg/pygame/__init__.py", line 95, in <module>
        from pygame.base import *
    ImportError: dlopen(/Library/Python/3.2/site-packages/pygame-1.9.1release-py2.7-macosx-10.7-intel.egg/pygame/base.so, 2): Symbol not found: _PyCObject_Type
      Referenced from: /Library/Python/3.2/site-packages/pygame-1.9.1release-py2.7-macosx-10.7-intel.egg/pygame/base.so
      Expected in: flat namespace
     in /Library/Python/3.2/site-packages/pygame-1.9.1release-py2.7-macosx-10.7-intel.egg/pygame/base.so
    >>>
    I managed another way to install and got new problems. Any solutions for any of my problems?

  5. #5

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,782
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    It would appear that Python 3.x is trying to use the 2.x version of Pygame which, as you saw, will never end well given the significant changes between 2.x and 3.x.

    The Pygame website suggests that it is mostly compatible with Python 3.x. However, it says you'll have to "copy and paste" files to make it work (see here). As to what that means is a bit of a mystery but I'm guessing that this means you'll have to copy the libraries from the 2.x site-packages folder to the 3.x one.

    I'm guessing Pygame will only work with a package manager (like MacPorts) if your whole Python workflow was built with MacPorts. In other words, the MacPorts pygame will work with a MacPorts compiled Python. If you're trying to use a MP Pygame with an official Python installation (or the system one), you'll probably run into trouble.
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  6. #6


    Member Since
    Apr 05, 2012
    Location
    Brazil
    Posts
    6
    Specs:
    MacMini 2007 running OS X Lion || 2GB RAM || 120GB HDD || 2,2GHz
    Thanks for the help, but still not working
    Actually, the system Python works just fine with the MP installed Pygame. The real problem is with the official one.

    I tried to copy-paste all the Pygame related folders from the 2.7 site-packages folder to the site-packages in the 3.2 folder, and still received an error message.

    I also reinstalled Python 3.2 via MP and reinstalled Pygame also from MP. Still the error persists.
    (PORTUGUESE) VAI TOMA NO CU SEU PYTHON DE MERDA (PORTUGUESE)

    Any ideas more? I would really appreciate using Pygame with Python 3.2 on Mac, but Pygame seems to be a little hard to get working.

  7. #7

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,782
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    Quote Originally Posted by xxViennaxx View Post
    Any ideas more? I would really appreciate using Pygame with Python 3.2 on Mac, but Pygame seems to be a little hard to get working.
    This doesn't surprise me since support for Python 3.x is spotty at best (when you look at the module ecosystem as a whole). It also doesn't surprise me that it works with the system Python since that's Python 2.x.

    I would imagine that the version of Pygame from MP would work with their build of Python. Thus, I wonder if you're using the binary installation of Python 3.x that you have installed without knowing it. MP installs its content to /opt/local so execute a "which python" to see what version of Python you're defaulting to. If you're defaulting to the Python.org (official) version, which will be installed to /Library/Frameworks/Python.framework/Versions, you can install the "python_select" tool from MP to switch the default.
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  8. #8


    Member Since
    Apr 05, 2012
    Location
    Brazil
    Posts
    6
    Specs:
    MacMini 2007 running OS X Lion || 2GB RAM || 120GB HDD || 2,2GHz
    I tried the "which python" and it returned /usr/bin/python, so I don`t know if this is the correct installation. If it isn`t, can you tell me how do I swich?

  9. #9

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,782
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    Unfortunately, that doesn't tell me much since that could either be the system Python or the MP one if it symlinked it to /usr/bin.

    Do an "ls -ld /usr/bin/python" and see if it points somewhere. You'll know it does if you get output similar to the following:
    Code:
    lrwxr-xr-x  1 root  wheel  75 20 Jul  2011 /usr/bin/python2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
    You can see there that /usr/bin/python2.7 is a symlink to /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7.

    As for changing it, see my python_select suggestion in my previous post.
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Mountain Lion won't let me install on my HDD?
    By drgrafix in forum OS X - Operating System
    Replies: 8
    Last Post: 02-04-2013, 06:44 PM
  2. Which pygame versions run with python 3 on mac
    By Mfred in forum OS X - Apps and Games
    Replies: 1
    Last Post: 09-10-2012, 11:24 PM
  3. Mountain Lion won't install.. Please help!!
    By emily312 in forum OS X - Operating System
    Replies: 3
    Last Post: 08-27-2012, 01:53 PM
  4. Won't start after os x lion install
    By Dulce4459 in forum OS X - Operating System
    Replies: 0
    Last Post: 10-26-2011, 10:08 PM
  5. Lion won't install on new mac
    By duncancox in forum OS X - Operating System
    Replies: 1
    Last Post: 08-23-2011, 10:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •