How to fix “could not find or load the Qt platform plugin windows” while using Matplotlib in PyCharm

前端 未结 21 1085
迷失自我
迷失自我 2020-12-02 13:00

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?

21条回答
  •  再見小時候
    2020-12-02 13:41

    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
    

提交回复
热议问题