【发布时间】:2016-04-01 10:21:53
【问题描述】:
我使用 Python 2.7 和 kivy 编写了一个 Windows 桌面应用程序,它在 pyCharm IDE 和 python 命令行中运行良好。使用 PyInstaller 构建分发包后,从 ..\dist\applicdir\ 运行应用程序,我收到 Kivy 致命错误:
GL:未找到最低要求的 OpenGL 版本 (2.0)!
怎么会?它在同一台 PC 上从 2 个不同的角度运行,但不是从同一台 PC 上的 dist 包运行。
你能解释一下为什么在前两种情况下我没有得到致命错误吗?
>>>>>>>>>>>>>> EDIT 1 <<<<<<<<<<<<<<<
[INFO ] [Logger ] Record log in ~\.kivy\logs\kivy_16-04-01_99.txt
[INFO ] [Kivy ] v1.9.1
[INFO ] [Python ] v2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015,20:32:19) [MSC v.1500 32 bit (Intel)]
[INFO ] [Factory ] 179 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_gif, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO ] [OSC ] using <thread> for socket
[INFO ] [Window ] Provider: sdl2
[WARNING ] The 'fake' fullscreen option has been deprecated, use Window.borderless or the borderless Config option instead.
[INFO ] [GL ] GLEW initialization succeeded
[INFO ] [GL ] OpenGL version <4.0.0 - Build 10.18.10.4176>
[INFO ] [GL ] OpenGL vendor <Intel>
[INFO ] [GL ] OpenGL renderer <Intel(R) HD Graphics 4000>
[INFO ] [GL ] OpenGL parsed version: 4, 0
[INFO ] [GL ] Shading version <4.00 - Build 10.18.10.4176>
[INFO ] [GL ] Texture max size <16384>
[INFO ] [GL ] Texture max units <16>
[INFO ] [Window ] auto add sdl2 input provider
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [Text ] Provider: sdl2
PyInstaller Bootloader 3.x
LOADER: executable is C:\Projects\UP52\PACKAGE\dist\up52creator\up52creator.exe
LOADER: homepath is C:\Projects\UP52\PACKAGE\dist\up52creator
LOADER: _MEIPASS2 is NULL
LOADER: archivename is C:\Projects\UP52\PACKAGE\dist\up52creator\up52creator.exe
LOADER: No need to extract files to run; setting extractionpath to homepath
LOADER: SetDllDirectory(C:\Projects\UP52\PACKAGE\dist\up52creator)
LOADER: Already in the child - running user's code.
LOADER: Python library: C:\Projects\UP52\PACKAGE\dist\up52creator\python27.dll
LOADER: Loaded functions from Python library.
LOADER: Manipulating environment (sys.path, sys.prefix)
LOADER: sys.prefix is C:\Projects\UP52\PACKAGE\dist\UP52CR~1
LOADER: Setting runtime options
LOADER: Initializing python
LOADER: Overriding Python's sys.path
LOADER: Post-init sys.path is C:\Projects\UP52\PACKAGE\dist\up52creator
LOADER: Setting sys.argv
LOADER: setting sys._MEIPASS
LOADER: importing modules from CArchive
LOADER: extracted struct
LOADER: callfunction returned...
LOADER: extracted pyimod01_os_path
LOADER: callfunction returned...
LOADER: extracted pyimod02_archive
LOADER: callfunction returned...
LOADER: extracted pyimod03_importers
LOADER: callfunction returned...
LOADER: Installing PYZ archive with Python modules.
LOADER: PYZ archive: out00-PYZ.pyz
LOADER: Running pyiboot01_bootstrap.py
no mem to add parser accelerators
Traceback (most recent call last):
File "<string>", line 21, in <module>
File "C:\Projects\UP52\qmonos.py", line 56, in showHome
recMgr = Manager()
File "C:\Python27\lib\multiprocessing\__init__.py", line 99, in Manager
m.start()
File "C:\Python27\lib\multiprocessing\managers.py", line 528, in start
self._address = reader.recv()
EOFError
qmonosmain returned -1
LOADER: OK.
LOADER: Cleaning up Python interpreter.
Traceback (most recent call last):
File "<string>", line 21, in <module>
Traceback (most recent call last):
File "<string>", line 21, in <module>
File "C:\Projects\UP52\qmonos.py", line 56, in showHome
recMgr = Manager()
File "C:\Projects\UP52\qmonos.py", line 56, in showHome
File "C:\Python27\lib\multiprocessing\__init__.py", line 99, in Manager
m.start()
recMgr = Manager()
File "C:\Python27\lib\multiprocessing\managers.py", line 528, in start
File "C:\Python27\lib\multiprocessing\__init__.py", line 99, in Manager
m.start()
self._address = reader.recv()
File "C:\Python27\lib\multiprocessing\managers.py", line 528, in start
EOFError
qmonosmain returned -1
LOADER: OK.
LOADER: Cleaning up Python interpreter.
self._address = reader.recv()
EOFError
qmonosmain returned -1
LOADER: OK.
LOADER: Cleaning up Python interpreter.
【问题讨论】:
-
类似this one的错误?
-
是的。我已经更新了显卡驱动,问题就解决了。但是在创建 PyInstaller 包后仍然无法让我的应用程序运行。现在“kivy”屏幕变黑了……
-
尝试 touchtracer,如果它有效,则说明您的代码有问题。还有一些调试(在 pyinstaller 中使用
--debug启用)日志会很好。 -
我测试了一个简单的自己开发的 kivy 应用程序,它运行良好。关注的应用程序利用了多处理。并查看一些帖子,这会给 PyInstaller 带来问题。应用程序陷入无限循环,产生进程和黑色窗口并消耗内存,直到机器完全阻塞。
-
我在上面添加了一些日志信息。见“>>>>>> EDIT 1
标签: windows python-2.7 opengl kivy