从windows服务打开时,Kivy抛出Open GL错误

2024-04-29 18:38:04 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试从Windows服务中使用pyinstaller绑定一个Kivy应用程序,但它无法打开,导致

OpenGL Version detected : 1.1

代码:

[INFO   ] [Kivy        ] v1.11.1
[INFO   ] [Kivy        ] Installed at "D:\PythonVENV\mist-app\dist\app\kivy\__init__.pyc"
[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:\PythonVENV\mist-app\dist\app\app.exe"
[INFO   ] [Factory     ] 184 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL" graphics system
[INFO   ] [GL          ] GLEW initialization succeeded
[INFO   ] [GL          ] No framebuffers extension is supported
[INFO   ] [GL          ] Backend used <glew>
[INFO   ] [GL          ] OpenGL version <b'1.1.0'>
[INFO   ] [GL          ] OpenGL vendor <b'Microsoft Corporation'>
[INFO   ] [GL          ] OpenGL renderer <b'GDI Generic'>
[INFO   ] [GL          ] OpenGL parsed version: 1, 1
[CRITICAL] [GL          ] Minimum required OpenGL version (2.0) NOT found!

OpenGL version detected: 1.1

Version: b'1.1.0'
Vendor: b'Microsoft Corporation'
Renderer: b'GDI Generic'

Try upgrading your graphics drivers and/or your graphics hardware in case of problems.

但问题是,我的GPU使用OpenGL4.6运行

当我执行它时,通常:

[INFO   ] [Logger      ] Record log in C:\Users\wasim\.kivy\logs\kivy_20-04-11_61.txt
[INFO   ] [deps        ] Successfully imported "kivy_deps.angle" 0.1.10
[INFO   ] [deps        ] Successfully imported "kivy_deps.glew" 0.1.12
[INFO   ] [deps        ] Successfully imported "kivy_deps.sdl2" 0.2.0
[INFO   ] [Kivy        ] v1.11.1
[INFO   ] [Kivy        ] Installed at "D:\PythonVENV\mist-app\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:\PythonVENV\mist-app\venv\Scripts\python.exe"
[INFO   ] [Factory     ] 184 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL" graphics system
[INFO   ] [GL          ] GLEW initialization succeeded
[INFO   ] [GL          ] Backend used <glew>
[INFO   ] [GL          ] OpenGL version <b'4.6.0 NVIDIA 445.75'>
[INFO   ] [GL          ] OpenGL vendor <b'NVIDIA Corporation'>
[INFO   ] [GL          ] OpenGL renderer <b'GeForce GTX 1060 3GB/PCIe/SSE2'>
[INFO   ] [GL          ] OpenGL parsed version: 4, 6
[INFO   ] [GL          ] Shading version <b'4.60 NVIDIA'>
[INFO   ] [GL          ] Texture max size <32768>
[INFO   ] [GL          ] Texture max units <32>
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[INFO   ] [KivyMD      ] v0.104.0
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [GL          ] NPOT texture support is available
[INFO   ] [Base        ] Start application main loop

我看到很多人对此表示不满,但问题是,该应用程序在正常运行时会按预期运行(没有服务弹出/独立)

我看到一些问题提到要更改为angle_sdl2,但它抛出了另一个错误,即“未找到有价值的windows提供程序”。我发现它使用了GL 3.2而不是4.6

启用“仅sdl”会引发相同的错误


Tags: depsinfoappimgversionwindowatopengl
1条回答
网友
1楼 · 发布于 2024-04-29 18:38:04

我终于解决了

你说得对!它确实是在不同的环境中运行的,改变环境并不能弥补工作的不足

这些服务在完全不同的环境中运行,并且限制了对登录用户桌面界面的访问

我试图在这里详细解释:Pystray icon available when running as a service

这对我有用

相关问题 更多 >