我使用python 3.6.8 IDLE。通过使用pip,我从官方网站上下载了Kivy 1.11.1。我安装了它没有任何问题,但是当我尝试运行“ Hello world”程序时,遇到了错误消息。
import kivy
from kivy.app import App
from kivy.uix.label import Label
class MyApp(App):
def build(self):
return Label(text="Romcha and Ivanez")
if __name__ == "__main__":
MyApp().run()
错误消息:
C:\Users\user\AppData\Local\Programs\Python\Python36\Romcha and ivanchik.py
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python36\Romcha and ivanchik.py", line 1, in <module>
import kivy
ModuleNotFoundError: No module named 'kivy'