openpyxl 报错AttributeError: 'int' object has no attribute 'upper'

714 篇文章 ¥9.90 ¥99.00
在使用openpyxl读取Excel时遇到AttributeError,提示'int' object has no attribute 'upper'。原因是旧版本的API已废弃。解决方法包括:1. 升级openpyxl到特定版本(如2.6.2),通过pip安装;2. 修改代码,使用sheet.cell(row=行数, column=列数).value的方式访问单元格。这两种方法都能有效解决问题。" 48738701,5004735,贝叶斯网络:理论与应用,"['数据挖掘', '机器学习', '自然语言处理', '统计模型', '网络分析']

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

报错信息:

/home/hdfs/anaconda2/lib/python2.7/site-packages/openpyxl/worksheet/worksheet.py:303: UserWarning: Using a coordinate with ws.cell is deprecated. Use ws[coordinate] instead
  warn("Using a coordinate with ws.cell is deprecated. Use ws[coordinate] instead")
Traceback (most recent call last):
  File "./excel_read.py", line 18, in <module>
    excel_read.run()
  File "./excel_read.py", line 10, in run
    print(sheet.cell(13, 2).internal_value)
  File "/home/hdfs/anaconda2/lib/python2.7/site-packages/openpyxl/worksheet/worksheet.py", line 304, in cell
    row, column = coordinate_to_tuple(coordinate)
  File "/home/hdfs/anaconda2/lib/python2.7/site-packages/openpyxl/utils/cell.py",

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

杨鑫newlfe

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值