FileNotFoundError: [Errno 2] No such file or directory:
- Translation: FileNotFoundError:[Errno 2] No such file or directory exists!
- Reason: File path error
catalogs
- Type I: Errors caused by relative paths
- Type 2: Wrong folder in the path
- Type III: Error when saving a file
Type I: Errors caused by relative paths
position, as shown in the following figure
Normal operation of the diagram
python working path change
The original code is not changed, then an error is reported
Type 2: Wrong folder in the path
Usually there is no folder created, or there is a typo in the handwritten path.
This can be done by looking at thefile (paper)
orfile path
judgement
Type III: Error when saving file
When loading data, the file path error can't be found and can be prompted. So why would the same error be reported when reporting an error file!
Reason:Folder error during path saving
Report an error:
Statements:
Analysis: The ellipsis in the file path is not omitted because the file path is too long, it is indeed a folder name error in my writing.