When packaging, replace the code with: pyinstaller --hidden-import=pkg_resources -F main.py
Can succeed.
It was originally designed to hide the code window during packaging. The absolute path was used. This problem was solved after changing to the above code.
Usage: pyinstaller38 --hidden-import=pkg_resources -F -w -i m4.ico main.py
Similar Posts:
- Pyinstaller publishes exe and pops up failed to execute script main
- Pyinstaller Package Error: ImportError: OpenCV loader: missing configuration file: [‘config.py‘]
- AttributeError: module ‘pip’ has no attribute ‘main’
- Python Error: “failed to execute pyi_rth_pkgres”
- [Solved] Flag + pyinstaller runs error after packaging: SystemError
- undefined reference to ‘WinMain@16’
- [Solved] Pyinstaller package Error: AttributeError: ‘str’ object has no attribute ‘decode’
- [Solution] systemerror: the solution of parent module ” not loaded, cannot perform relative Import
- Handling method of PIP error in pycharm installation
- Pyinstall package py script warning: lib not found and other related issues