Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python3 importing pygame results in PyCObject_AsVoidPtr

I have encountered difficulty putting pygame together with python3 on my MacBookPro.

I installed Python 3.3, and my MacOS is running version 10.7.5.

Then I downloaded pygamev1.9.1 source code, and followed instructions in http://programming.itcarlow.ie/PyGameInstall.pdf

Compilation and installation was smooth until I issued "import pygame" inside python3.

Then I encountered the following "PyCobJect_AsVoidPtr" error (further text following error message):

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

A search on google indicates this symbol has been removed since Python3.2:

http://mail.python.org/pipermail/python-dev/2011-March/108882.html

Can someone please give me some advice on how to get pygame working on Python3.3?

More so, whereas I am aware the pygame/python3 developers are busy with their work, but I would certainly appreciate it if someone can provide precompiled pygame binaries for python3. I have limited computer skills, and I just want to go ahead and learn Python3 and pygame, and this is seriously stunting my interest.

like image 753
user1850494 Avatar asked Nov 13 '22 16:11

user1850494


1 Answers

I notice that you were trying to compile from source, but builds on Python 3.3, to my knowledge, are not yet supported (as of January 2013). In fact, the only binaries I'm aware of for PyGame and Python 3.3 are unofficial builds and Windows only.

You should consider instead using a previous version of Python (e.g. Python 2.7.*), PyGame builds/binaries on which are well-supported. Any points on setting up should be directed to the pygame-users mailing list, if they weren't already.

like image 91
imallett Avatar answered Nov 15 '22 09:11

imallett