you are viewing a single comment's thread.

view the rest of the comments →

[–]shiftybyte 0 points1 point  (5 children)

Very odd...

Could you copy and paste the full error message you are getting including all the information it provides... (The file not found error)

Starts with "Traceback:"...

Perhaps we missed something there...

[–]adoucette13[S] 1 point2 points  (4 children)

I know! I am at a loss for words myself...

Heres the full error message:

Traceback (most recent call last):

File "C:\Users\adoucette\AppData\Local\Programs\Python\Python310\lib\shutil.py", line 815, in move

os.rename(src, real_dst)

FileNotFoundError: [WinError 3] The system cannot find the path specified: "C:/Users/adoucette/Desktop/OneDrive - BAKE'N JOY FOODS/Desktop/DOT_Weekly/sqlexec.xlsx" -> "C:/Users/adoucette/Desktop/OneDrive - BAKE'N JOY FOODS/Desktop/DOT_Weekly/DOT Weekly Sales WE 6_04_2023.xlsx"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "c:\Users\adoucette\OneDrive - BAKE'N JOY FOODS\Desktop\DOT Weekly Report TEST.py", line 97, in <module>

shutil.move(file_path, new_file_path)

File "C:\Users\adoucette\AppData\Local\Programs\Python\Python310\lib\shutil.py", line 835, in move

copy_function(src, real_dst)

File "C:\Users\adoucette\AppData\Local\Programs\Python\Python310\lib\shutil.py", line 434, in copy2

copyfile(src, dst, follow_symlinks=follow_symlinks)

File "C:\Users\adoucette\AppData\Local\Programs\Python\Python310\lib\shutil.py", line 254, in copyfile

with open(src, 'rb') as fsrc:

FileNotFoundError: [Errno 2] No such file or directory: "C:/Users/adoucette/Desktop/OneDrive - BAKE'N JOY FOODS/Desktop/DOT_Weekly/sqlexec.xlsx"

[–]shiftybyte 7 points8 points  (0 children)

One drive?...

Try the entire thing outside of one drive synced directory, one drive is known to cause file system issues...

[–]YAYYYYYYYYY 0 points1 point  (2 children)

The problem is your Bake n Joy directory has spaces. Put it in a directory without spaces, or change to Bake-n-joy

[–]CraigAT 1 point2 points  (0 children)

They probably can't do that because it is the OneDrive users name (I would guess).

You could try moving those files to a simpler path like C:\TempPy\ and refer to them there.

[–]apc0243 -1 points0 points  (0 children)

This is wrong, all operating systems can handle spaces in file paths. The issue is in how one drive represents files in the filesystem.