Pyinstaller "Failed to execute script pyi_rth_pkgres" and missing packages

Solution 1:

same problem here:

  • OS: Win10
  • Python: 3.7
    • pyinstaller installed by pip install pyinstaller

fix by (same solution with above, by no need download):

pip uninstall pyinstaller
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip

Solution 2:

Extending Vikash Kumar's answer, build the application by adding the --hidden-import argument to the command.

For example, running the command given below worked for me.

"pyinstaller --hidden-import=pkg_resources.py2_warn example.py"

update: added missing "="