繁体   English   中英

Python 3.7.7 Kivy:找不到任何有价值的 Window 提供程序。 sdl2 - ValueError: 不是 boolean: 400

[英]Python 3.7.7 Kivy: Unable to find any valuable Window provider. sdl2 - ValueError: Not a boolean: 400

我被这个问题困住了。 我试图安装我在互联网上找到的所有先决条件。 我正在使用 Windows 10 和 CMDer。 这个错误也发生在我运行的 Kivy 的任何程序中。 这是错误详细信息。

    (kivy_venv) λ python main.py -d
[INFO   ] [Logger      ] Record log in C:\Users\DC\.kivy\logs\kivy_20-04-05_71.txt
[INFO   ] [deps        ] Successfully imported "kivy_deps.gstreamer" 0.1.18
[INFO   ] [deps        ] Successfully imported "kivy_deps.angle" 0.1.10
[INFO   ] [deps        ] Successfully imported "kivy_deps.sdl2" 0.1.23
[INFO   ] [Kivy        ] v1.11.1
[INFO   ] [Kivy        ] Installed at "D:\Fazar\Terminal\kivy_venv\lib\site-packages\kivy\__init__.py"
[INFO   ] [Python      ] v3.7.7 (tags/v3.7.7:d7c567b08f, Mar 10 2020, 10:41:24) [MSC v.1900 64 bit (AMD64)]
[INFO   ] [Python      ] Interpreter at "D:\Fazar\Terminal\kivy_venv\Scripts\python.exe"
[INFO   ] [Factory     ] 184 symbols loaded
[DEBUG  ] [Cache       ] register <kv.lang> with limit=None, timeout=None
[DEBUG  ] [Cache       ] register <kv.image> with limit=None, timeout=60
[DEBUG  ] [Cache       ] register <kv.atlas> with limit=None, timeout=None
[INFO   ] [ImageLoaderFFPy] Using ffpyplayer 4.3.1
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_ffpyplayer, img_gif
[DEBUG  ] [Cache       ] register <kv.texture> with limit=1000, timeout=60
[DEBUG  ] [Cache       ] register <kv.shader> with limit=1000, timeout=3600
[DEBUG  ] [App         ] Loading kv <.\pong.kv>
[INFO   ] [Window      ] Provider: sdl2
[CRITICAL] [Window      ] Unable to find any valuable Window provider. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the config) and re-run your app to identify potential causes
sdl2 - ValueError: Not a boolean: 400
  File "D:\Fazar\Terminal\kivy_venv\lib\site-packages\kivy\core\__init__.py", line 71, in core_select_lib
    cls = cls()
  File "D:\Fazar\Terminal\kivy_venv\lib\site-packages\kivy\core\window\window_sdl2.py", line 152, in __init__
    super(WindowSDL, self).__init__()
  File "D:\Fazar\Terminal\kivy_venv\lib\site-packages\kivy\core\window\__init__.py", line 981, in __init__
    self.create_window()
  File "D:\Fazar\Terminal\kivy_venv\lib\site-packages\kivy\core\window\window_sdl2.py", line 284, in create_window
    resizable = Config.getboolean('graphics', 'resizable')
  File "D:\Fazar\Software\Python37\lib\configparser.py", line 828, in getboolean
    raw=raw, vars=vars, fallback=fallback, **kwargs)
  File "D:\Fazar\Software\Python37\lib\configparser.py", line 808, in _get_conv
    **kwargs)
  File "D:\Fazar\Software\Python37\lib\configparser.py", line 802, in _get
    return conv(self.get(section, option, **kwargs))
  File "D:\Fazar\Software\Python37\lib\configparser.py", line 1160, in _convert_to_boolean
    raise ValueError('Not a boolean: %s' % value)

[CRITICAL] [App         ] Unable to get a Window, abort.

我已经安装了 pygments、pypiwin32、kivy_deps.sdl2、kivy_deps.angle、kivy_deps.gstreamer 和 Kivy 本身。 我现在一点头绪都没有。 如果您有解决此问题的建议,请回答。

注意:Kivy 程序之前运行成功,现在它不再工作了,我尝试重新安装 Python 3.7.7 和 Kivy 几次进出虚拟环境

通过配置C:\Users\<UserName>\.kivy\config.ini修复的错误:

[graphics]
display = -1
fullscreen = 0
height = 600
left = 0
maxfps = 60
multisamples = 2
position = auto
rotation = 0
show_cursor = 1
top = 0
width = 800
resizable = 1
borderless = 0
window_state = visible
minimum_width = 0
minimum_height = 0
min_state_time = .035
allow_screensaver = 1
shaped = 0

可调整大小的值必须为 1 或 0。否则可能会导致 windows 提供程序错误。 此外,安装 preresquisites 以避免另一个错误:

  1. python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew kivy.deps.angle
  2. python -m pip install kivy_deps.gstreamer

暂无
暂无

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

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