pyinstall Failed to execute script 'main' due to unhandled exception: [WinError 3] The system cannot find the specified path, including the folder

question

Failed to execute script 'main' due to unhandled exception: [WinError 3] The system cannot find the specified path

The package file contains the folder YOLOv5 Utils
Insert image description here

Solution

Baidu's online method cannot be used. I studied pyinstaller and found that as long as the main file is imported into the folder, the package can be packaged directly. As shown in the
Insert image description here
figure , the required package can be directly introduced into the main file. If it is gray, it is correct. Import it explicitly and do not use it. The automatic optimization reference of the program is run directly, and no error will be reported.

pyinstaller -D -w main.py  

Guess you like

Origin blog.csdn.net/TY_GYY/article/details/128594021