1. PyCharm press Alt + F12 Open dialog Terminal
1.1 wxpython my project files in directory, D: \ learn \ Weather index insurance \ wxpython> pyinstaller -F -w teaindex_main.py
After the end of the run in 1.2 D: \ learn \ Weather index insurance \ dist folder and generate the build folder wxpython directory, my exe program in dist folder, double-click the exe pop up:
1.3 Terminal again in the dialog box, run D: \ \ Weather index insurance \ wxpython> pyinstaller -F teaindex_main.py, run the exe, you can learn to see the problem, the lack of module typedefs
1.4 look for a solution online
The package code is changed to:
D:\learn\Weather index insurance\wxpython>pyinstaller -F teaindex_main.py --hidden-import sklearn
.neighbors.typedefs
The problem is solved! Successfully generated can run the exe file