Pyinstaller publishes exe and pops up failed to execute script main

Detailed map traversal, teach you to master the complex gremlin query debugging method>>>

1. Press Alt + F12 in pychar to open the terminal dialog box

1.1 my project files are placed in the wxPython directory, D: learn, weather index insurance, wxPython > pyinstaller -F -w teaindex_

1.2 after running, the dist folder and build folder will be generated in the directory D: learn, weather index insurance and wxPython. My exe program is in the dist folder. Double click the EXE to pop up:

1.3 in the terminal dialog box again, run D: learn, weather index insurance, wxPython > pyinstaller -F -c teaindex_, run exe, you can see the problem, the lack of module typedefs

You should use: pyinstaller – F – C After packaging, click exe to execute the file. If an error is reported, it will be displayed on the console. This is, to prepare for the screenshot, because the console error is a flash

1.4 refer to online solutions

Change the packing code to:

D:\learn\Weather index insurance\wxpython> pyinstaller -F -c teaindex_ –hidden-import sklearn.neighbors.typedefs

The problem is solved! The executable file is generated successfully

1.5 generate the program with icon D: learn, weather index insurance, wxPython > pyinstaller -F -w -i sunny.ico teaindex_ –hidden-import sklearn.neighbors.typedefs

1.6 can find existing pyqt5 plugin directories when packaging. The specific screenshot is as follows


Search pyqt5 with everything, find the pyqt5 folder under the path of/library/plugins, and copy the DLL Dynamic Library pyqt5qmlplugin.dll

According to the path of the error prompt, create a new folder one by one, and form the directory C:: (qt5b) QT_ 1524647842210\_ h_ Env library plugins, copy the DLL dynamic library just copied in

1.7 in addition to the above module, no module named ‘sklearn. Utils_ cython_ Blas’, add this module to the end, as shown below

pyinstaller -F -w teaindex_ –hidden-import sklearn.neighbors.typedefs –hidden-import sklearn.utils._ cython_ blas

Similar Posts: