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/Pluginsplugins 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.