Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using sdl2 in Kivy instead of pygame

I couldn't resize my windows on the applications i made with Kivy, so I found out using sdl2, instead of Pygame, with Kivy can fix this. I uninstalled Kivy and Pygame, then installed sdl2, then reinstalled Kivy. Kivy still is trying to use pygame though. Please Help.

File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/kivy/core/__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)

File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/kivy/core/window/window_pygame.py", line 8, in <module>
import pygame
like image 520
Bill Avatar asked Aug 27 '16 18:08

Bill


2 Answers

The easiest way to fix this is to purge your current kivy install and re-install it fresh using the following links as a reference point (these are the official installation instructions)

https://kivy.org/docs/installation/installation-windows.html

With that being said please note the following, do to an issue with a few compilers 1.9.2 doesn't work on windows with python 3.5 this is an ongoing issue the kivy team is aware of and working on.

So this means you're left with using python 3.4 for the newest version(s) of kivy on windows. Kivy no longers uses pygame and should by default prompt you to install sdl2.

The only issue you may have with the official instructions in the link I provided is setting up GStreamer if it gives you a problem you can skip that and just grab a ported version which suffices.

If you're on Linux then just re-install :)

like image 139
suroh Avatar answered Sep 23 '22 05:09

suroh


I had the same issue on my new Mac (Sierra). I followed the suggestion at https://github.com/kivy/kivy/issues/4688

and installed the latest version of Kivy using the command
USE_OSX_FRAMEWORKS=0 pip install https://github.com/kivy/kivy/zipball/master

This worked for me, and Kivy is now using SDL2 and not looking for pygame. (I also answered this at: Kivy support for SDL2 in Virtualenv)

like image 29
Lindsay Ward Avatar answered Sep 21 '22 05:09

Lindsay Ward