PyQt5 - Failed to load platform plugin “windows”. Available platforms are: windows, minimal

前端 未结 8 1079
伪装坚强ぢ
伪装坚强ぢ 2020-12-06 02:27

When I try to run any PyQt5 program from Eclipse, I got this error.

Failed to load platform plugin \"windows\". Available platforms are: windows, mini

8条回答
  •  Happy的楠姐
    2020-12-06 03:04

    I found the file: qwindows.dll needed to be included to allow my .exe file to run independently without getting the error. To do so, add the qwindows.dll path to your data files list:

    setup(windows=[YOURSCRIPT.py]
    , data_files = [('.','DRIVE:\PythonPath\Lib\site-packages\PyQt4\plugings\platforms\qwindows.dll')]) 
    

    The reason you would do this and now set your environment path is that your program will run on any machine if the qwindows.dll file is held in the same package. If you only set the environment variable, the program will only successfully run on a computer with PyQt installed.

提交回复
热议问题