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?
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?
I had the same problem with Anaconda3 4.2.0 and 4.3.0.1 (64-bit). When I tried to run a simple program that uses matplotlib, I got this error message:
Reinstalling didn't fix it.
What helped was this (found here): Look for the Anaconda directory and set the
Library\plugins
subdir (herec:\ProgramData\Anaconda3\Library\plugins
) as environment variableQT_PLUGIN_PATH
under Control Panel / System / Advanced System Settings / Environment Variables.After setting the variable you might need to restart PyCharm, if the change does not have an immediate effect.
Et voilà!
Update: Even though after that the command line Python worked, TexWorks (which uses Qt as well) displayed an error message very much like it. Setting the
QT_PLUGIN_PATH
to the directory containing TexWorks' Qt DLLs (hereC:\Users\chris\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64
) fixed the problem for both programs.I found that this was being caused by having the MiKTeX binaries in my PATH variable; and the wrong Qt dll's were being found. I just needed to re-arrange the PATH entries.
(Dependency Walker is such a useful tool.)
If you want to visualize your matplotlibs in an alternative way, use a different backend that generates the graphs, charts etc.
import matplotlib matplotlib.use('TKAgg')
This worked for me.
If installed
PyQt5
andPySide2
, I solved problemCopy the following files
to
I tried the following in Anaconda prompt, and it solved this problem:
conda remove qt
conda remove pyqt
conda install qt
conda install pyqt
On Windows
1- Copy the folder plastforms: C:\Users\%USERNAME%\AppData\Roaming\pyinstaller\bincache00_py35_64bit\pyqt5\qt\plugins\platforms
2- Paste the folder platform into the folder location of the file .exe
Example: c:\MyFolder\yourFile.exe c:\MyFolder\platforms