When I try to run any PyQt5 program from Eclipse, I got this error.
Failed to load platform plugin \"windows\". Available platforms are: windows, mini
This is what worked for me while using the Anaconda Python 3.6 distribution:
I installed PyQt5 using pip install pyqt5
. What this does is it creates a Qt/Plugins
plugins directory in the ../Anaconda3/Lib/site-packages/PyQt5
path.
Following Roger Allen and uetoyo, I added:
if os.name == "nt": # if windows
from PyQt5 import __file__
pyqt_plugins = os.path.join(os.path.dirname(__file__), "Qt", "plugins")
QApplication.addLibraryPath(pyqt_plugins)
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = pyqt_plugins
to my script. It works with pyinstaller as well.
Copy C:\Python34\Lib\site-packages\PyQt5\libEGL.dll
to the same directory as your .exe.
Source: http://bird1110.blogspot.com/2014/04/python-33-pyqt5-and-cxfreeze-exe-on-64.html