PyQt5和PySide2 / /即使找到了Qt平台插件“ windows”,也无法在“”中加载

时间:2019-02-27 17:40:03

标签: python-3.x qt pyqt5 pyside2

开发环境

 1. Windows 10 / Python 3.6.8 / Pyinstaller 3.4 / PyQt5 5.10
 2. Windows 10 / Python 3.6.8 / Pyinstaller 3.4 / PySide2 5.11.0
 3. Windows 10 / Python 3.6.8 / Pyinstaller 3.4 / PyQt5 5.9.2

执行环境

Windows Server 2008 SP2

在情况1、2中:发生以下错误。

qt.qpa.plugin: Could not load the Qt platform plugin "windows" in "" even though it was found.
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.

但是情况3:没有错误。

测试高于Qt 5.10的版本的结果与案例1、2相同。

我必须使用PySide2。但是PySide2的版本不低于Qt 5.9.2。

使用PySide2是否有避免错误的方法?

1 个答案:

答案 0 :(得分:0)

使用Anaconda:

conda install -c conda-forge pyside2 

但是是较旧的版本。 (v5.6) 使用旧版本,到目前为止,我没有遇到任何问题。我对新版本有同样的问题,但是我需要它,因为旧版本不支持QtCharts