The error "file not found" usually means your script is trying to access a file that:
-
Doesn't exist at the specified location
-
Has a wrong file path or filename
-
Is located in a different directory than the script expects
Â
✅ Common Things to Check:
1. Check the File Path
-
Is the path relative or absolute?
-
If you're using a relative path, make sure you’re running the script from the correct working directory.
2. Check the File Name
-
Is the file name spelled exactly right? (File extensions too:
.txt
,.csv
, etc.) -
File systems like Linux/macOS are case-sensitive:
-
"input.txt"
â‰"Input.txt"
-
3. Check File Location
-
Is the file in the same folder as your script (for relative paths)?
-
If not, either:
-
Move the file to where the script expects it.
-
Or change the path in your script.
-
4. Escape Backslashes on Windows
-
If you’re using Windows:
5. Check Script’s Working Directory
-
You can print it to debug:
-
That’s the folder your relative paths are based on.