解决this application failed to start

运行Pyside2时出现如下图所示错误:
错误内容:This application failed to start because not Qt platform plugin could be initialized.Reinstalling the application may fix this problem.

解决this application failed to start_第1张图片

解决方案

将PySide2路径下的plugins\platforms添加到系统环境变量中用户变量里。我的路径如下:D:\deeplearningenvironment\anaconda3\site\envs\pytorch\Lib\site-packages\PySide2\plugins\platforms

1、win+r打开命令行,在命令行输入sysdm.cpl,打开系统属性高级选项

解决this application failed to start_第2张图片

解决this application failed to start_第3张图片

2、接着就可以配置环境变量

解决this application failed to start_第4张图片 解决this application failed to start_第5张图片

 

变量名:QT_QPA_PLATFORM_PLUGIN_PATH
变量值:D:\deeplearningenvironment\anaconda3\site\envs\pytorch\Lib\site-packages\PySide2\plugins\platforms
不同用户,变量名一致,变量值随文件位置变。
最后,保存变量后,一定要重启电脑,因为新的环境变量要重启后才能被系统识别! 

通过以上步骤,bug即可被修复

你可能感兴趣的:(YOLOV5bug修复,python,pytorch,人工智能,机器学习)