Tag Archives: Initializing

Python reports oserror: initializing from file failed

phenomenon description:

When

opens a file, the newspaper Initializing from file failed to initialize the file.

the original statement is:

df=pd.read_csv(r’ job list query by original expected date 529.csv’)

reason analysis:

is because the file path contains Chinese. Since the default engine of read_csv function is C, Chinese recognition is not supported, so this error is reported. This is a common problem when using notebook to open files.

solution:

change engine=’python’ executes successfully.

df=pd.read_csv(r’ job list query by original expected date 529. CSV ‘,engine=’python’)