import kivy
from kivy import *
#kivy.require('1.10.1') # replace with your current kivy version !
#from kivy.deps import sdl2, glew
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()
第一:
python -m pip install --upgrade pip wheel setuptools
python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2
.deps.glew
python -m pip install kivy.deps.gstreamer
python -m pip install kivy.deps.angle
python -m pip install kivy
python -m pip install kivy_examples
python -m pip install Pillow
python -m pip install cython
错误:
回溯(最近通话最近一次):
File "C:\Users\1\Desktop\kivy.py", line 1, in <module> import kivy File "C:\Users\1\Desktop\kivy.py", line 7, in <module> from kivy.app import App ModuleNotFoundError: No module named 'kivy.app'; 'kivy' is not a package
答案 0 :(得分:0)
只需在python终端中输入pip install kivy
,您可能尚未安装它。