<small id='MXS6t'></small><noframes id='MXS6t'>

  • <i id='MXS6t'><tr id='MXS6t'><dt id='MXS6t'><q id='MXS6t'><span id='MXS6t'><b id='MXS6t'><form id='MXS6t'><ins id='MXS6t'></ins><ul id='MXS6t'></ul><sub id='MXS6t'></sub></form><legend id='MXS6t'></legend><bdo id='MXS6t'><pre id='MXS6t'><center id='MXS6t'></center></pre></bdo></b><th id='MXS6t'></th></span></q></dt></tr></i><div id='MXS6t'><tfoot id='MXS6t'></tfoot><dl id='MXS6t'><fieldset id='MXS6t'></fieldset></dl></div>
      <bdo id='MXS6t'></bdo><ul id='MXS6t'></ul>

    <tfoot id='MXS6t'></tfoot>
      <legend id='MXS6t'><style id='MXS6t'><dir id='MXS6t'><q id='MXS6t'></q></dir></style></legend>

        SDL2 错误:“无法加载图像 &lt;default.png&gt;

        时间:2023-10-10
          <bdo id='FHpac'></bdo><ul id='FHpac'></ul>

              <small id='FHpac'></small><noframes id='FHpac'>

                <i id='FHpac'><tr id='FHpac'><dt id='FHpac'><q id='FHpac'><span id='FHpac'><b id='FHpac'><form id='FHpac'><ins id='FHpac'></ins><ul id='FHpac'></ul><sub id='FHpac'></sub></form><legend id='FHpac'></legend><bdo id='FHpac'><pre id='FHpac'><center id='FHpac'></center></pre></bdo></b><th id='FHpac'></th></span></q></dt></tr></i><div id='FHpac'><tfoot id='FHpac'></tfoot><dl id='FHpac'><fieldset id='FHpac'></fieldset></dl></div>

                <tfoot id='FHpac'></tfoot>
              • <legend id='FHpac'><style id='FHpac'><dir id='FHpac'><q id='FHpac'></q></dir></style></legend>
                  <tbody id='FHpac'></tbody>
                1. 本文介绍了SDL2 错误:“无法加载图像 &lt;default.png&gt;"使用 pyinstaller 冻结 kivy 应用程序时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我无法使用 pyinstaller 生成工作 exe(应用程序的名称是 settings_gui).

                  I'm unable to produce a working exe with pyinstaller (the name of the app is settings_gui).

                  运行时错误:(完整日志)

                  [WARNING           ] [Image       ] Unable to load image <<project_path>distSETTIN~1kivy_installdataglsldefault.png>
                  [CRITICAL          ] [Window      ] Unable to find any valuable Window provider
                  at all!
                  sdl2 - Exception: SDL2: Unable to load image
                    File "site-packageskivycore\__init__.py", line 67, in core_select_lib
                    File "site-packageskivycorewindowwindow_sdl2.py", line 138, in __init__
                    File "site-packageskivycorewindow\__init__.py", line 722, in __init__
                    File "site-packageskivycorewindowwindow_sdl2.py", line 255, in create_wind
                  ow
                    File "site-packageskivycorewindow\__init__.py", line 897, in create_window
                    File "kivygraphicsinstructions.pyx", line 756, in kivy.graphics.instructions
                  .RenderContext.__init__ (kivygraphicsinstructions.c:10729)
                    File "site-packageskivycoreimage\__init__.py", line 512, in __init__
                    File "site-packageskivycoreimage\__init__.py", line 700, in _set_filename
                    File "site-packageskivycoreimage\__init__.py", line 430, in load
                    File "site-packageskivycoreimage\__init__.py", line 198, in __init__
                    File "site-packageskivycoreimageimg_sdl2.py", line 42, in load
                  
                  [CRITICAL          ] [App         ] Unable to get a Window, abort.
                   Exception SystemExit: 1 in 'kivy.properties.dpi2px' ignored
                  [INFO              ] [Text        ] Provider: sdl2
                   Traceback (most recent call last):
                     File "settings_gui.py", line 26, in <module>
                   AttributeError: 'NoneType' object has no attribute 'clearcolor'
                  Failed to execute script settings_gui
                  

                  出了什么问题?我检查了 <project_path>/dist/settings_gui/kivy_install/data/glsl/default.png,它就在那里.我觉得很奇怪,但是路径是 SETTING~1,这正常吗?我看过 this thread 建议通过 _MEIPASS<重定向资源/code>,但这无济于事 - 意料之中,因为我不是在单文件模式下构建我的应用程序.

                  What is going wrong? I checked <project_path>/dist/settings_gui/kivy_install/data/glsl/default.png, it's there. I find it weird however that the path is SETTING~1, is that normal? I've seen this thread which recommends to redirect the resources through _MEIPASS, but this doesn't help - expectedly, since I'm not building my app in one-file-mode.

                  感谢任何有关如何解决此问题的提示.

                  Any tip on how to troubleshoot this is appreciated.

                  编辑:

                  更多信息:

                  • 没有 pyinstaller,应用程序运行得非常好——除非我关闭它或以其他方式停止它;当我这样做时,python 崩溃了.
                  • 当我构建我的应用程序时,会打开一个 kivy 窗口并立即崩溃.我总是关闭它并继续构建过程.
                  • 我的 .spec 文件
                  • 构建日志

                  推荐答案

                  我通过复制文件解决了这个问题

                  I managed to fix the issue by copying file

                  From: [Python]sharesdl2inlibpng16-16.dll
                  To:   [Dist]<projectName>libpng16-16.dll
                  

                  那里已经有一个文件实例,但我替换它的那个实例大了大约 20kb(从 198kb 到 213kb).

                  There was an instance of the file already there but the one I replaced it with was about 20kb larger (from 198kb to 213kb).

                  重要的是我的应用程序现在可以运行,我没有更改任何其他内容.

                  The important part is that my app works now and I didn't change anything else.

                  这篇关于SDL2 错误:“无法加载图像 &lt;default.png&gt;"使用 pyinstaller 冻结 kivy 应用程序时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                2. <small id='WCMLI'></small><noframes id='WCMLI'>

                          <tbody id='WCMLI'></tbody>
                        <tfoot id='WCMLI'></tfoot>
                          <bdo id='WCMLI'></bdo><ul id='WCMLI'></ul>

                          <i id='WCMLI'><tr id='WCMLI'><dt id='WCMLI'><q id='WCMLI'><span id='WCMLI'><b id='WCMLI'><form id='WCMLI'><ins id='WCMLI'></ins><ul id='WCMLI'></ul><sub id='WCMLI'></sub></form><legend id='WCMLI'></legend><bdo id='WCMLI'><pre id='WCMLI'><center id='WCMLI'></center></pre></bdo></b><th id='WCMLI'></th></span></q></dt></tr></i><div id='WCMLI'><tfoot id='WCMLI'></tfoot><dl id='WCMLI'><fieldset id='WCMLI'></fieldset></dl></div>
                          <legend id='WCMLI'><style id='WCMLI'><dir id='WCMLI'><q id='WCMLI'></q></dir></style></legend>