Does Kivy work with Thonny?

142 views
Skip to first unread message

Jim Lindsay

unread,
Jul 19, 2019, 8:05:34 PM7/19/19
to Kivy users support
I'm a teacher.  I've had my students using Thonny, and it has worked well for us.
I want to use Kivy to get some phone apps up and running, I believe that will really turn my students on.
*****
from kivy.app import App
from kivy.uix.label import Label  # exception thrown here

class Test(App):
 
    def build(self):
        return Label("label")

Test().run()
******************************
BUT -- I can't get Kivy to even bring up its window!  I'm get all of the following errors (and a bunch of stack trace lines) when I try to import Label:
   sdl2 - ImportError: DLL load failed: The specified module could not be found.
   pil - ModuleNotFoundError: No module named 'PIL'
   [CRITICAL] [App         ] Unable to get a Text provider, abort.
I've spent hours searching for and trying to find solutions, and trying many, many suggestions.
I really need a way to get Kivy up and running in a fairly simple way -- i.e. by utilizing Thonny's Package Manager.
I have 75 students, I can't set up each machine myself!

Has anyone run into this?  Has anyone got Kivy working with Thonny?

-- Jim

Robert Flatt

unread,
Jul 19, 2019, 11:33:56 PM7/19/19
to Kivy users support
Not finding" sdl2.dll", so assuming you are using Windows, some things to try:

1) Are the Kivy dependencies installed?

At a Windows command prompt this should return some info (assuming Kivy 1.11.*) :
pip show kivy-deps.sdl2

2) Repeat at the Thonny System Shell prompt

3) Will the example run at the Windows command prompt?

4) Will the example run at the Thonny System Shell prompt?

I am not a Thonny user, I notice it is for beginners.
Be aware porting Kivy apps to Android/iOS is in general not push button.
The example will port (try Buildozer without Thonny)
But one can very quickly run into OS or processor architecture issues that require specialized knowelege.
A working app will indeed turn your students on, but frustration at issues they have not studied may turn them off.

Elliot Garbus

unread,
Jul 20, 2019, 1:48:57 PM7/20/19
to kivy-...@googlegroups.com

Follow the directions for Installation on Kivy.org for your platform.

https://kivy.org/doc/stable/gettingstarted/installation.html

 

You next problem is you call to Label.  Change as shown below.

 
def build(self):
   
return Label(text="label")

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/0e0d0b47-a1cc-43e2-b592-ee209b505831%40googlegroups.com.

 

Reply all
Reply to author
Forward
0 new messages