简体   繁体   中英

No Module Name 'kivy'

Ok, here is the deal, I've followed the instructions from kivy home page

and everything went well. I added the repository by entering this command into the terminal:

sudo add-apt-repository ppa:kivy-team/kivy

Then updated it

sudo apt-get update

And installed kivy on Ubuntu 18.04

sudo apt-get install python3-kivy

Then I'd run a simple app-code

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

from kivy.app import App
from kivy.uix.label import Label

class MyApp(App):
def build(self):
    return Label(text='Hello world')

if __name__ == '__main__':
MyApp().run()

And I received this:

Traceback (most recent call last): File "/home/.../Documents/coding/python/kivy_apps/main.py", line 1, in from kivy.app import App ModuleNotFoundError: No module named 'kivy'

I need a little help in getiing this problem solved. Would be appreciate for any help.

kivy will be installed in any version of python that is less than python==3.7.5

so do make sure you switch to such python and check again..simply type this in the termal

python3.version

and try the import statement

sudo apt-get install python3-pip

pip(3) 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