cannot import name 'App' from 'kivy.app' (E:\renpy project\flashlight\game/python-packages/kivy/app.py)

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
Li yuanlin
Regular
Posts: 94
Joined: Sat Aug 04, 2018 8:42 pm
Location: Hong Kong
Contact:

cannot import name 'App' from 'kivy.app' (E:\renpy project\flashlight\game/python-packages/kivy/app.py)

#1 Post by Li yuanlin »

sems to be slash backslash problem,can someone help me?

Code: Select all

init python:
    from kivy.app import App
    from kivy.uix.button import Button
    from kivy.utils import platform
stay hungry,stay foolish.

User avatar
Li yuanlin
Regular
Posts: 94
Joined: Sat Aug 04, 2018 8:42 pm
Location: Hong Kong
Contact:

Re: cannot import name 'App' from 'kivy.app' (E:\renpy project\flashlight\game/python-packages/kivy/app.py)

#2 Post by Li yuanlin »

does anybody know?
stay hungry,stay foolish.

User avatar
Andredron
Miko-Class Veteran
Posts: 722
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: cannot import name 'App' from 'kivy.app' (E:\renpy project\flashlight\game/python-packages/kivy/app.py)

#3 Post by Andredron »

First of all what version of kivy are you using and how did you import it in the first place?
game/python-packages/kivy/__init__.py and finding the line starting with

Code: Select all

__version__ =
make sure that the file game/python-packages/kivy/app.py is not corrupted and contains the correct definition of the App class. You can check this by opening the file in a text editor and making sure it contains the line class App(EventDispatcher):.

try deleting the file game/python-packages/kivy/__pycache__/app.cpython-*.pyc if it exists. This file may contain compiled code that is causing the import error, and deleting it may help fix the problem.

User avatar
Li yuanlin
Regular
Posts: 94
Joined: Sat Aug 04, 2018 8:42 pm
Location: Hong Kong
Contact:

Re: cannot import name 'App' from 'kivy.app' (E:\renpy project\flashlight\game/python-packages/kivy/app.py)

#4 Post by Li yuanlin »

Andredron wrote: Sun Mar 31, 2024 11:20 am First of all what version of kivy are you using and how did you import it in the first place?
game/python-packages/kivy/__init__.py and finding the line starting with

Code: Select all

__version__ =
make sure that the file game/python-packages/kivy/app.py is not corrupted and contains the correct definition of the App class. You can check this by opening the file in a text editor and making sure it contains the line class App(EventDispatcher):.

try deleting the file game/python-packages/kivy/__pycache__/app.cpython-*.pyc if it exists. This file may contain compiled code that is causing the import error, and deleting it may help fix the problem.
but I didn't find line contains __version__ = in __init__.py
stay hungry,stay foolish.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: cannot import name 'App' from 'kivy.app' (E:\renpy project\flashlight\game/python-packages/kivy/app.py)

#5 Post by PyTom »

I wouldn't expect this to work.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Andredron
Miko-Class Veteran
Posts: 722
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: cannot import name 'App' from 'kivy.app' (E:\renpy project\flashlight\game/python-packages/kivy/app.py)

#6 Post by Andredron »

😮‍💨😮‍💨😮‍💨

Then I can't help you, because it's not clear how you imported kivy into renpy, maybe you are trying to import the latest kivy in renpy version of python 2.7, which doesn't support ancient python, and vice versa.

As Mr. Python rightly pointed out, kivy and renpy are a huge hassle to merge, I'm speaking as someone who tried to port kivy before renpy with python 3.10 support was available


Writing Mr. Python. viewtopic.php?p=552380#p552380

I writing
viewtopic.php?p=538187&hilit=Kivy#p538187

It is better to use Pyjinus to work with android.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Majestic-12 [Bot]