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

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

    I have the same issue and fixed in this way In Anaconda installation folder I went to : (change it to your installed path): C:\ProgramData\Anaconda3\Lib\site-packages\PySide2 Edit this file by adding the following code lines :

    # below the line 23 type.__signature__
        pyside_package_dir =  os.path.abspath(os.path.dirname(__file__))
        dirname = os.path.dirname(__file__)
        plugin_path = os.path.join(dirname, 'plugins', 'platforms')
        os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = plugin_path
    

    save this file and try again and the issue should be gone :)

提交回复
热议问题