I'm trying to write a script where it will move a directory (containing images to be processed) into another dedicated working directory by using shutil.move(). However, my Python script keeps on failing to achieve this by throwing an [Errno 2] No such file or directory: '/Users/user/Desktop/Captured\\ Images' exception. The target directory is being perfectly recognised so that's not the issue.

This is how I input the path of the source directory (by dragging the folder into the terminal): /Users/user/Desktop/Captured\ Images.

This is how Python interprets the source directory: /Users/user/Desktop/Captured\\ Images.

The script works perfectly when I modify the source path to: /Users/user/Desktop/Captured Images.


I assume that the fact that the directory contain's a \ is what causing the issue? But then Pathlib should be taking care of that shouldn't it?