Code no longer works after Pycharm update.

16 views
Skip to first unread message

Abraham Francisco

unread,
Apr 19, 2020, 4:01:44 PM4/19/20
to Kivy users support
code:

from kivy.app import App
from kivy.lang import Builder
from kivy.uix.button import Button
from kivy.clock import Clock
from kivy.properties import StringProperty
from kivy.uix.label import Label

from time import strftime

kv
= """
<Home@Screen>:
    BoxLayout:
        orientation: 'vertical'
        MyClock:
            font_size: 50
            text: self.current_time
        Button:
            background_color: [128,0,0,.6]
            text: 'Set Alarm'
            on_press: app.root.ids.sm.current = 'alarm_page'
<AlarmPage@Screen>:
    Button:
        text: 'Put alarms on this page'
        on_release: app.root.ids.sm.current = 'home_page'

BoxLayout:
    ScreenManager:
        id: sm
        Home:
            name: 'home_page'
        AlarmPage:
            name: 'alarm_page'

"""


class MyClock(Label):
    current_time
= StringProperty(strftime("%I:%M:%S %p"))

   
def __init__(self, **kwargs):
       
Clock.schedule_interval(self.update_time, 1)
       
super().__init__(**kwargs)

   
def update_time(self, dt):
       
self.current_time = strftime("%I:%M:%S %p")


class MainApp(App):
   
def build(self):
       
return Builder.load_string(kv)


if __name__ == "__main__":
   
MainApp().run()

I get this error:

[CRITICAL] [Window      ] Unable to find any valuable Window provider. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the config) and re-run your app to identify potential causes
sdl2 - ImportError: DLL load failed: The specified module could not be found.
  File "C:\Users\Owner\Anaconda3\envs\Aggro-Alarm\lib\site-packages\kivy\core\__init__.py", line 63, in core_select_lib
    fromlist=[modulename], level=0)
  File "C:\Users\Owner\Anaconda3\envs\Aggro-Alarm\lib\site-packages\kivy\core\window\window_sdl2.py", line 27, in <module>
    from kivy.core.window._window_sdl2 import _WindowSDL2Storage

[CRITICAL] [App         ] Unable to get a Window, abort.


What did I screw up?

Elliot Garbus

unread,
Apr 19, 2020, 4:26:31 PM4/19/20
to kivy-...@googlegroups.com
Check that your interpreter is set to the right file. 

Sent from my iPhone

On Apr 19, 2020, at 1:02 PM, Abraham Francisco <fran...@gmail.com> wrote:


--
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/c89ff5ed-808c-4989-8592-8b09cd8e1e63%40googlegroups.com.

Robert Flatt

unread,
Apr 19, 2020, 5:05:50 PM4/19/20
to Kivy users support
Try
   pip list
Are the Kivy dependencies installed?
Is this the right virtual environment?

Abraham Francisco

unread,
Apr 19, 2020, 5:34:44 PM4/19/20
to Kivy users support
I just reinstalled Kivy. Maybe I needed to update, but on reinstall it listed a lot of things that had to be downgraded but just did it anyways. Seemed to work. Is there no way to update kivy without uninstalling it first as the kivy site says? I'm using Conda.
 Thanks again everyone.

Elliot Garbus

unread,
Apr 19, 2020, 5:41:12 PM4/19/20
to kivy-...@googlegroups.com

On the setting screen in Pycharm, make sure you have selected the proper project Interpreter.

 

--

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.

Abraham Francisco

unread,
Apr 19, 2020, 5:45:25 PM4/19/20
to Kivy users support
I did. Its the same I've always used. : )

I just reinstalled Kivy and it worked. I don't understand but at least it opens now.

To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages