Samar Yadav Samar Yadav - 9 months ago 68
Python Question

Kivy, ImportError: cannot import name App

everything was working fine on my ubuntu machine and suddenly i can't import

App
from
kivy.app


from kivy.app import App


enter image description here

Answer Source

enter image description here

One of Kivy's internal module weakmethod.py is trying to import another internal module new.py. But you have create a new.py next to where you run python, so Python will try to load yours first. This breaks everything because weakmethod doesn't expect that your new.py, it wants the internal new.py!. The solution is to rename this offending file.

(The actual problem causing ImportError is circular import on the kivy.app module)