Use pyinstaller to package the .py file, execute the generated .exe and report an error, as shown in the following figure:
Reason: The .py file uses a relative path, but the generated .exe is in the dist directory, so the execution error occurs.
Solution: Change the relative path to an absolute path and repackage. OK!