Error “could not find or load the Qt platform plug

2019-02-08 07:56发布

I am getting the error "could not find or load the Qt platform plugin windows" while using matplotlib in PyCharm.

How can I solve this?

enter image description here

11条回答
SAY GOODBYE
2楼-- · 2019-02-08 08:10

You may need to copy the "plugins" file in on "Anaconda3\Library"(for example in my computer is "S:\Anaconda3\Library\plugins") to the same path of your .exe file.

查看更多
Bombasti
3楼-- · 2019-02-08 08:11

I had a similar problem with PyCharm where things worked great in main run but not in debugger, getting the same error message. This happened for me because I had moved my Anaconda installation to a different directory. The debugger goes and checks a qt.conf file that is located at the same place as python. This location can be found by running import sys; print sys.executable. I found this solution through a pile of web searches and it was buried deep here. The qt.conf file needs to have correct paths for debugger to work.

My qt.conf files looks like this in notepad:

[Paths]
Prefix = E:/python/Anaconda3_py35/Library
Binaries = E:/python/Anaconda3_py35/Library/bin
Libraries = E:/python/Anaconda3_py35/Library/lib
Headers = E:/python/Anaconda3_py35/Library/include/qt
查看更多
手持菜刀,她持情操
4楼-- · 2019-02-08 08:17

Pycharm Console or Debugger showing this issue - Could not find or load the Qt platform plugin windows

Reason - Python exe file may be located at a different location for Pycharm interpreter, you might manually select it in file,settings,interpreter.

Solution -

  1. Set the working directory. File ->Settings-> Build, Execution, Deployment ->Console ->Python Console -> Working directory. Set it to parent directory where your all codes are present.

  2. Open Control Panel-> System Settings -> Advanced System Settings ->Environment Variables ->New. Set Variable Name: QT_PLUGIN_PATH , Variable Directory:Users\\Appdata\Local\Continuum\Anaconda2\Library\plugins

  3. Restart Pycharm.

查看更多
兄弟一词,经得起流年.
5楼-- · 2019-02-08 08:18

I copy the folder \Anaconda3\Library\plugins\platforms to \$\ where $ represents your project interpreter folder (Ex:"\project\anaconda_env\Scripts\") , because PyCharm calls the python.exe in this folder, not the one in \Anaconda3. and solve my problem.

查看更多
Deceive 欺骗
6楼-- · 2019-02-08 08:28

In my case, I had multiple combined problems in order to make PyQt5 run on Windows, see DLL load failed when importing PyQt5

查看更多
登录 后发表回答