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


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

 

 解决方案

临时解决

添加

import os
import PySide2
dirname = os.path.dirname(PySide2.__file__)
plugin_path = os.path.join(dirname, 'plugins', 'platforms')
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = plugin_path

永久解决

添加环境变量

C:\ProgramData\Miniconda3\Lib\site-packages\PySide2\plugins\platforms

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM