【问题标题】:Why is my Python reading only csv files and not xlsx files?为什么我的 Python 只读取 csv 文件而不读取 xlsx 文件?
【发布时间】:2021-02-18 11:08:15
【问题描述】:

我的 Python 不是读取 xlsx (excel) 文件,而是仅读取 csv。我有所有更新的 Python 版本 (39)、pip、xlrd、pandas。还是没有结果。请帮忙!

已经做到了:pip install xlrd,显示要求已经满足。

输入:

import pandas as pd

df= pd.read_excel("测试文件 1.xlsx" , "A") df

错误:

    err_msg = "Install xlrd >= 1.0.0 for Excel support"

AttributeError: 'ElementTree' 对象没有属性 'getiterator'

【问题讨论】:

  • 来自herexlrd 将无法在 Python 3.9 或更高版本中运行。

标签: python python-3.x excel pandas xlrd


【解决方案1】:

您还必须安装 xlrd。 pip install xlrd

【讨论】:

    猜你喜欢
    • 2021-11-05
    • 1970-01-01
    • 1970-01-01
    • 2018-05-28
    • 1970-01-01
    • 1970-01-01
    • 2019-12-04
    • 1970-01-01
    • 2014-11-30
    相关资源
    最近更新 更多