This problem can occur when the contents of row[folder_header] is of type float rather than string - e.g. if the value at that location is 1.0 then you will be trying to string join "some_path" and 1.0 which will not work. You should be able to resolve this by changing line 64 to read: target_folder_path = os.path.join(organized_folder_path, str(target_folder_path)) Hope that helps.
Steve From: [email protected] <[email protected]> On Behalf Of Adi F. Sent: Friday, July 28, 2023 3:42 PM To: PyInstaller <[email protected]> Subject: [PyInstaller] pyw file runs fine, but after converting to exe getting "Unhandled exception in script" error Hi. I have a script in Python that organizes files into folders based on a file and folder list in an Excel file. Full disclosure: My Python and coding skills are pretty basic and I did get help from ChatGPT when creating this script The script is working fine and I get no errors when I run the python file (pyw). Now, I want this script to be accessible to anyone, regardless of whether they have Python installed or not, and regardless of Python version, so I'm encapsulating the script in an .exe file using PyInstaller. When running the .exe created by PyInstaller - the script functions correctly and the results are as intended, but I get the following error message: Unhandled exception in script Failed to exectue script 'files_to_folders_per_excel_v2.2' due to unhandled exception: join() argument must be str, bytes, or os.PathLike object, not 'float' Traceback (most recent call last): File "files_to_folders_per_excel_v2.2.pyw", line 64, in <module> File "ntpath.py", line 143, in join File "genericpath.py", line 152, in _check_arg_types TypeError: join() argument must be str, bytes, or os.PathLike object, not 'float' Here's the Python code in github: https://github.com/zevelj/files-to-folders/blob/main/files_to_folders_per_excel_v2.1.pyw If anyone has any ideas how I can make the exe file run without any error messages, please let me know. Thanks! -- You received this message because you are subscribed to the Google Groups "PyInstaller" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]<mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/f9c01e30-df36-4ca7-a429-ee9097bc5639n%40googlegroups.com<https://groups.google.com/d/msgid/pyinstaller/f9c01e30-df36-4ca7-a429-ee9097bc5639n%40googlegroups.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "PyInstaller" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/DU0P194MB1819696B5FCCE1BB7AD8AEB79B04A%40DU0P194MB1819.EURP194.PROD.OUTLOOK.COM.
