2021-09-02pythonno Qt platform plugin could be initialized

Python

no Qt platform plugin could be initialized问题的解决办法

今天因要使用到一个以前PyQT写得工具,但运行时报错:
This application failed to start because no Qt platform plugin could be initialized
方法一可能原因:环境变量QT_PLUGIN_PATH指派错误
方法二单独设置环境变量QT_QPA_PLATFORM_PLUGIN_PATH才能找到新版Qt的路径,QT_QPA_PLATFORM_PLUGIN_PATH的值指向PyQt5路径下Qt\plugins子目录。在某的机器中环境变量设置为:
C:\ProgramData\Anaconda3\Lib\site-packages\PyQt5\Qt\plugins

你可能感兴趣的:(python,QT,qt)