I’m trying to move a file in Python using
shutil.move() , but I keep getting a
FileNotFoundError: [Errno 2] No such file or directory error.
This is the error message:
FileNotFoundError: [Errno 2] No such file or directory: '/path/to/source/file.txt'
Here’s my code:
I’ve double-checked the file paths, and they are correct. What could be causing this error? Are there any alternative ways to move a file in Python?