Search code examples
pythonpython-3.xpyqt5pyinstallerexe

How to solve the unexpected pyinstaller exception "pyqt5_plugins distribution was not found"?


I wrote a window application using the PyQt5 library. After compiling by "pyinstaller" when trying to run the exe file, the following error occurs:

Error

I tried to reinstall pyqt5_plugins library, compile the program without the "--windowed" option, or remove errors from the "warn-main.txt" file, nothing helped. Has anyone encountered such a problem?


Solution

  • Use

    --copy-metadata pyqt5_plugins --copy-metadata qt5_tools --copy-metadata qt5_applications --hidden-import qt5_tools --collect-submodules qt5_applications --collect-submodules pyqt5_plugins
    

    EDIT:
    For me I need several copy-metadata and collect-submodules to work.