reference resources: https://stackoverflow.com/questions/37815371/pyinstaller-failed-to-execute-script-pyi-rth-pkgres-and-missing-packages
First, uninstall pyinstaller, then download and install it from GitHub
pip uninstall pyinstaller
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
Bloggers solve the problem through the above methods