FileNotFoundError:[Errno 2],但路径正确

问题描述 投票:0回答:1
import pandas as pd

data = pd.read_excel(r'C:\Users\ПеКа476\Desktop\Matrices\118_OG_6-sec_imcoh_sensors_4-8.xlsx')
print(data)

我有这个错误:

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\ПеКа476\\Desktop\\Matrices\\118_OG_6-sec_imcoh_sensors_4-8.xlsx'

enter image description here

enter image description here路径完全正确:C:\ Users \ПеКа476\ Desktop \ Matrices \ 118_OG_6-sec_imcoh_sensors_4-8.xlsx —我从文件描述中获取。谁能帮忙,我做错了什么?我试图阅读有关此问题的其他问题,但到处都是平等的问题:不完整的路径名等。但是在我的情况下,该路径几乎是正确的

python python-3.x file-not-found
1个回答
0
投票

打开excel文件。

单击文件。

转到“信息”

单击“复制路径”

这可确保复制正确的路径,包括正确的扩展名。

© www.soinside.com 2019 - 2024. All rights reserved.