Installing 64 bit pygame to work with 64 bit kivy

203 views Asked by At

I'm trying to use kivy on my Macbook Pro running 10.12.1. The kivy version I have installed is 64 bit, but the pygame version is 32 bit, so when I run a basic kivy program I get returned this error:

    pygame - ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so, 2): Symbol not found: _SDL_EnableUNICODE
  Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so
  Expected in: flat namespace
 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kivy/core/__init__.py", line 59, in core_select_lib
    fromlist=[modulename], level=0)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kivy/core/text/text_pygame.py", line 12, in <module>
    import pygame
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/__init__.py", line 133, in <module>
    from pygame.base import *

What is the workaround for this? I've got a bunch of 64 bit modules I want to use so don't want to switch entirely to 32 bit python.

Thanks.

2

There are 2 answers

0
Mikhail Gerasimov On

The kivy version I have installed is 64 bit, but the pygame version is 32 bit

You can't arbitrarily choose bitness of module. You should find and install module with same bitness as CPython interpreter you use has.

Take a look at this article and solution it provides.

0
inclement On

Kivy's pygame support is long deprecated, although it probably still does work. Instead you should use SDL2 - this should be done automatically if you follow the Kivy install instructions.