gogoWebsite

【report an error】FileNotFoundError: [Errno 2] No such file or directory

Updated to 4 months ago

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 pathjudgement
在这里插入图片描述

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.