简体   繁体   中英

from kivy.app import App ModuleNotFoundError: No module named 'kivy' error

When I try to run this code:

from kivy.app import App

class TheLabApp(App):
  pass

TheLabApp().run()

it says:

line 1, in from kivy.app import App ModuleNotFoundError: No module named 'kivy'

So what should i do to stop this problem?

I checked in the local environment and got the same problem. When I looked at the sample codes from the main website, I noticed this code.

Can you try this?

import kivy
kivy.require('2.1.0') # replace with your current kivy version !

from kivy.app import App

在此处输入图像描述

Have you installed the package?

Try the following code in your CMD terminal.

pip install kivy

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM