3

I have been attempting to install the pygame module on my macbook pro running snow leapord. the python version i am running on is 3.2

I have been following instructions from here in order to build and install the module from source. when running the build i get the following warning many times:

Quote:

file was built for i386 which is not the architecture being linked (x86_64)

when running the python IDLE i am able see the pygame module listed as on of the available modules

but when i try to import the module i receive the following:

Quote:

import pygame Traceback (most recent call last): File "", line 1, in import pygame File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/pygame/init.py", line 95, in from pygame.base import * ImportError: dynamic module does not define init function (PyInit_base)

I am assuming that this is some sort of linking issue but i do not know how to approach solving it... would very much appreciate any thought as i do not have any programming bg whatsoever.

I just tried Michael's answer out but received the following (new) error:

import pygame Traceback (most recent call last): File "", line 1, in import pygame File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/pygame/init.py", line 95, in from pygame.base import * ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/pygame/base.so, 2): Symbol not found: _PyCObject_AsVoidPtr Referenced from: /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/pygame/base.so Expected in: flat namespace in /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/pygame/base.so

any ideas?

Barvazos
  • 41
  • 6

2 Answers2

2

You have a fancy computer there, Barvazos. And the instructions you have there (circa 2009) say nothing about 64-bit architectures (or 32 bit versus 64 bit universal builds & libraries), which is now a consideration that developers have to care about these days.

If this were my problem, my first attempt to fix this would be to change "Step 6" on Paul Barry's instruction sheet (which you linked to in your question) to say:

export CC='/usr/bin/gcc-4.2' CFLAGS='-isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64'

(in case it's not clear, the thing that I added to that Step 6 line is the -arch x86_64 bit)

And if this does turn out to be the solution, e-mail the author of that instruction sheet and tell him to update that PDF file to be relevant for 2012. He'd probably appreciate the support. I hope this answer helps you out!

Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215
  • unfortunately no success yet... see my edited question with results for what you have suggested. appreciate your help – Barvazos Jan 07 '12 at 12:49
0

I have successfully installed pygame on osx lion using the following instructions https://bitbucket.org/pygame/pygame/issue/82/homebrew-on-leopard-fails-to-install#comment-627494

dm03514
  • 54,664
  • 18
  • 108
  • 145
  • thanks, not very familiar with homebrew but i will give it a go. can i ask for what version of Python was the install done? – Barvazos Jan 07 '12 at 13:27