简体   繁体   English

尝试运行简单 Kivy 程序时出错 (Windows)

[英]Error When Trying to Run Simple Kivy Program (Windows)

When trying to run the following program on my computer:尝试在我的计算机上运行以下程序时:

# First import an App class from kivy
from kivy.app import App
# Define App subclass
class TutorialApp(App):
    pass
if __name__=="__main__":
    TutorialApp().run()

After I added what was suggested( The last two lines ), I get two syntax errors, the first telling me to delete the colon and the second telling me to remove the indent, and then this:在我添加了建议的内容(最后两行)后,我收到了两个语法错误,第一个告诉我删除冒号,第二个告诉我删除缩进,然后是:

[INFO              ] Kivy v1.8.0
[INFO              ] [Logger      ] Record log in C:\Users\rabbitrabbit\.kivy       \logs\kivy_14-08-15_5.txt
[INFO              ] [Factory     ] 157 symbols loaded
[DEBUG             ] [Cache       ] register <kv.lang> with limit=None, timeout=Nones
[DEBUG             ] [Cache       ] register <kv.image> with limit=None, timeout=60s
[DEBUG             ] [Cache       ] register <kv.atlas> with limit=None, timeout=Nones
[INFO              ] [Image       ] Providers: img_tex, img_dds, img_gif (img_pygame,  img_pil ignored)
[DEBUG             ] [Cache       ] register <kv.texture> with limit=1000, timeout=60s
[DEBUG             ] [Cache       ] register <kv.shader> with limit=1000, timeout=3600s
[DEBUG             ] [App         ] Loading kv <C:\Python33\tutorial.kv>
[DEBUG             ] [App         ] kv <C:\Python33\tutorial.kv> not found
[DEBUG             ] [Window      ] Ignored <egl_rpi> (import error)
[DEBUG             ] [Window      ] Ignored <pygame> (import error)
[WARNING           ] [WinPygame   ] SDL wrapper failed to import!
[DEBUG             ] [Window      ] Ignored <sdl> (import error)
[DEBUG             ] [Window      ] Ignored <x11> (import error)
[CRITICAL          ] [Window      ] Unable to find any valuable Window provider at all!
[CRITICAL          ] [App         ] Unable to get a Window, abort.

According to the tutorial I'm following( http://inclem.net/2014/01/09/kivy-crash-course/1_making-a-simple-app/ ), the program should be able to run without problems.根据我正在关注的教程( http://inclem.net/2014/01/09/kivy-crash-course/1_making-a-simple-app/ ),该程序应该能够毫无问题地运行。 I've installed Kivy and Python 3.3.我已经安装了 Kivy 和 Python 3.3。

If that's really your program, the problem is simply that it doesn't do anything.如果那真的是你的程序,那么问题就在于它什么都不做。 Use TutorialApp().run() to actually start the gui.使用TutorialApp().run()实际启动 gui。

Either way, that traceback is not an error.无论哪种方式,回溯都不是错误。

看起来您缺少pygame的安装 - Kivy 安装未将其作为依赖项引入,因此您需要单独安装它 - 请参阅http://kivy.org/docs/installation/troubleshooting-macosx.html#无法找到任何有价值的窗口提供者错误

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试在 pycharm 中运行简单的 kivy 程序时出错 - Error when trying to run simple kivy program in pycharm Windows上尝试运行简单程序的RuntimeError - RuntimeError on Windows trying to run a simple program 尝试使用 kivy 在 vi​​rtualbox ubuntu 中运行我的 python 程序时出现语法错误 - Syntax error when trying to run my python program in virtualbox ubuntu with kivy 尝试运行我的简单程序时未定义全局名称“ transact” - Global name 'transact' not defined when trying to run my simple program 无法运行简单程序 - Python - Kivy - Ubuntu - Can't run simple program- Python - Kivy - Ubuntu 尝试使用 package 使用 kivy 制作的带有 buildozer 的简单计算器应用程序时出现错误“adb:安装失败” - Error 'adb: failed to install' when trying to package a simple calculator app with buildozer made using kivy 尝试使用 Python27 运行 Kivy 应用程序时出错:引发异常(&#39;SDL2:无法加载图像&#39;) - Error when trying to run Kivy app with Python27: raise Exception('SDL2: Unable to load image') Kivy中的绑定按钮使程序运行时功能运行 - Binding button in Kivy makes funciton run when the program is run 尝试运行python程序时出现“没有名为caffe的模块”错误 - “No module named caffe” error when trying to run python program 尝试在 MacOS 上运行 Kivy 应用程序,但运行时出现黑屏 - Trying to Run Kivy Application on MacOS, but getting black screen when run
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM