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
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
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