| OS X - Development and Darwin Discussion and questions about development for Mac OS X. |
| Post Reply | New Thread | Subscribe |
|
|
Thread Tools |
![]() Member Since: Apr 05, 2012
Location: Brazil
Posts: 6
![]() Mac Specs: MacMini 2007 running OS X Lion || 2GB RAM || 120GB HDD || 2,2GHz
|
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
|
| QUOTE Thanks | |
![]() Member Since: Oct 19, 2008
Location: Ottawa
Posts: 15,331
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac 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 :: M-F IRC Channel - Chats every Sunday at 8PM EST. |
| QUOTE Thanks | |
![]() Member Since: Apr 05, 2012
Location: Brazil
Posts: 6
![]() Mac Specs: MacMini 2007 running OS X Lion || 2GB RAM || 120GB HDD || 2,2GHz
|
Quote:
EDIT: I re-checked the stdarg.h file and it is re-directing the Code:
#include_next <stdarg.h> Last edited by xxViennaxx; 04-05-2012 at 09:38 AM. |
|||||
| QUOTE Thanks | ||||||
![]() Member Since: Apr 05, 2012
Location: Brazil
Posts: 6
![]() Mac Specs: MacMini 2007 running OS X Lion || 2GB RAM || 120GB HDD || 2,2GHz
|
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 >>> 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
>>>
|
| QUOTE Thanks | |
![]() Member Since: Oct 19, 2008
Location: Ottawa
Posts: 15,331
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: 2012 13" MBP (2.5 i5, 8GB)
|
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 :: M-F IRC Channel - Chats every Sunday at 8PM EST. |
| QUOTE Thanks | |
![]() Member Since: Apr 05, 2012
Location: Brazil
Posts: 6
![]() Mac Specs: MacMini 2007 running OS X Lion || 2GB RAM || 120GB HDD || 2,2GHz
|
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. |
| QUOTE Thanks | |
![]() Member Since: Oct 19, 2008
Location: Ottawa
Posts: 15,331
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: 2012 13" MBP (2.5 i5, 8GB)
|
Quote:
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 :: M-F IRC Channel - Chats every Sunday at 8PM EST. |
|
| QUOTE Thanks | ||
![]() Member Since: Apr 05, 2012
Location: Brazil
Posts: 6
![]() Mac Specs: MacMini 2007 running OS X Lion || 2GB RAM || 120GB HDD || 2,2GHz
|
|
| QUOTE Thanks | |
![]() Member Since: Oct 19, 2008
Location: Ottawa
Posts: 15,331
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac 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 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 :: M-F IRC Channel - Chats every Sunday at 8PM EST. |
| QUOTE Thanks | |
| Post Reply | New Thread | Subscribe |
| Thread Tools | |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|
|||||||
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| lion install OVER lion?? | maxcanoe | OS X - Operating System | 6 | 11-16-2011 11:15 AM |
| Mac OS X Lion clean install may need Snow Leopard disc | OneMoreThing... | Apple Rumors and Reports | 1 | 06-21-2011 06:19 PM |
| Mac Users Get More ISP Choices | schweb | Apple Rumors and Reports | 1 | 03-06-2003 10:57 AM |
All times are GMT -4. The time now is 02:19 AM.
Powered by vBulletin