网上看了很多办法,都没啥用,下面是我自己的解决方案:
首先安装pyqt5:
pip install PyQT5
pip install PyQT5-tools
我的工程目录是C:\python\PycharmProjects\qt_example1,点击designer.exe,发现启动失败
C:\python\PycharmProjects\qt_example1\venv\Lib\site-packages\pyqt5_tools\Qt\bin\designer.exe
解决方案:把目录下的文件C:\python\PycharmProjects\qt_example1\venv\Lib\site-packages\PyQt5\Qt\plugins\platforms\qwindows.dll 替换覆盖到下面的目录即可:
C:\python\PycharmProjects\qt_example1\venv\Lib\site-packages\pyqt5_tools\Qt\bin\platforms\qwindows.dll