【发布时间】:2021-09-16 12:44:23
【问题描述】:
你如何解决这个问题?使用 Python 对 Spyder 进行一些培训,我认为 Bitdefender 的阻止权限让我读取 Excel 文件。有谁知道如何授予权限?我不断收到相同的 FileNotFoundError
代码如下:
import pandas as pd
df = pd.read_excel(r'C:\Users\user\.spyder-py3\housing')
print(df)
返回为:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\user\\.spyder-py3\\housing'
【问题讨论】:
-
我看不到该文件的扩展名。可能是文件名类似于 Housing.xls 或 Housing.xlsx ,您必须首先找到真正的文件名。很可能你有一个寡妇设置不显示文件扩展名。
-
为什么在你显示的代码中有
user.spyder-py3时你的错误消息中有user\.spyder-py3?