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

前端 未结 21 879
迷失自我
迷失自我 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:56

    I solved it by:

    • Adding a path:

      \Anaconda3\Lib\site-packages\PyQt5\Qt\bin to PATH.
      
    • Setting an environment variable:

      QT_PLUGIN_PATH as \Anaconda3\Lib\site-packages\PyQt5\Qt\plugins or \Anaconda3\Library\plugins.

    • Also, you can try:

      pyqt = os.path.dirname(PyQt5.__file__)
      os.environ['QT_PLUGIN_PATH'] = os.path.join(pyqt, "Qt/plugins")
      
    0 讨论(0)
  • 2020-12-02 13:58

    I tried the following at Anaconda's prompt, and it solved this problem:

    conda remove qt
    conda remove pyqt 
    conda install qt 
    conda install pyqt
    
    0 讨论(0)
  • 2020-12-02 13:58

    copy the plugins from PySide2 and paste and overwrite the existing plugins in Miniconda worked for me.

    (base) C:\ProgramData\Miniconda3\Lib\site-packages\PySide2\plugins\platforms>copy *.dll  C:\ProgramData\Miniconda3\Library\plugins\platforms\
    
    0 讨论(0)
提交回复
热议问题