PySide2安装运行后报如下错误:
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: direct2d, minimal, offscreen, windows.
不完美的解决方案:
有的教程说重装
有的教程说 将Anaconda3\Lib\site-packages\PySide2\plugins\platforms下的DLL文件复制替换到\Anaconda3\Library\plugins\platforms下
这样的做法会导致原本用于Anaconda和Spyder的文件被替换,使得Anaconda和Spyder无法打开!
亲测有效的解决方案:
在系统环境设置中,新建变量:QT_QPA_PLATFORM_PLUGIN_PATH
路径为XXX\Anaconda3\Lib\site-packages\PySide2\plugins\platforms
ps:更新系统变量或需要重启后生效。