首页 > 解决方案 > PyInstaller 4. 仅在一台机器上从子进程启动 Maya 2020 时出现 4 Qt 平台错误

问题描述

我有一个问题,我无法从 PyInstaller 4.4 中冻结的应用程序中使用 subprocess.Popen 启动 Maya 2020。当我启动它时,我收到以下错误:

This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: minimal, offscreen, webgl, windows, direct2d.

启动 Maya 的代码如下

process = subprocess.Popen(dccPath, env=self.getPreparedEnviroment(), creationflags=subprocess.CREATE_NEW_CONSOLE)

我已经尝试过这篇文章中提出的解决方案,但没有奏效。

http://discourse.techart.online/t/unable-to-launch-maya-2022-using-popen-from-a-pyinstaller-exe/13747

我正在使用 Python 3.7.9、PyInstaller 4.4 和 PySide2 5.15.2。

奇怪的是,它不能在一台机器上运行,而是在我尝试过的所有其他机器上运行。此外,它还适用于 Python 2.7 和 PyQt4。回去不是一个选择。当直接从 Windows 或在常规 Python 环境中运行的应用程序中启动 Maya 时,它也可以工作。

有谁知道可能是什么原因造成的?

标签: pythonpyqt5pyinstallermayapyside2

解决方案


推荐阅读