openpyxl中遇到TypeError: 'generator' object is not subscriptable的问题和解决方案
今天在搭建驱动数据框架用到了一个叫 openpyxl的包用来解析excel数据
随后就出现了TypeError: 'generator' object is not subscriptable的bug具体上图

问题出现在 print(pe.getCellOfObject(sheet, rowNo=1, colsNo=1))
仔细检查半天代码发现也没有问题啊,最后问度娘才知道是版本号的问题
由于我装的是openpyxl3.0.0的版本 只要更换2.3.3 或者 2.3.5版本即可
解决方案:t
更换openpyxl的版本 建议更换为2.3.3或者2.3.5
openpyxl中遇到TypeError: 'generator' object is not subscriptable的问题和解决方案的更多相关文章
- openpyxl使用sheet.rows或sheet.columns报TypeError: 'generator' object is not subscriptable解决方式
解决方案: 因为新版本的openpyxl使用rows或者columns返回一个生成器所以可以使用List来解决报错问题 >>> sheet.columns[0] Traceback ...
- Debug 路漫漫-11:Python: TypeError: 'generator' object is not subscriptable
调试程序,出现以下错误: Python: TypeError: 'generator' object is not subscriptable “在Python中,这种一边循环一边计算的机制,称为生成 ...
- TypeError: 'generator' object is not subscriptable
TypeError: 'generator' object is not subscriptable 生成器对象不可以带下标 def get_row(self,row_no): if not isin ...
- python: "TypeError: 'type' object is not subscriptable"
目前stackoverflow找到两种情况的解决办法: 1.TypeError: 'type' object is not subscriptable when indexing in to a di ...
- TypeError: 'NoneType' object is not subscriptable
运行,显示TypeError: 'NoneType' object is not subscriptable错误信息,原因是变量使用了系统内置的关键字list 重新定义下这个变量就好了
- python报错:TypeError: 'int' object is not subscriptable
检查一遍报错的所在行,此报错一般是在整数上加了下标: 比如: a = 4 c=a[2] 报错:line 2, in <module> c=a[2] TypeError: 'i ...
- python报以下错误:TypeError: 'int' object is not subscriptable
原因:数组忘了写下标,数组某项赋值成了 数组对象=数字: 查询其它人的博客,发现仍有其它可能引发此错误,无非是不可以相互操作的对象进行了操作或者是访问对象的方式不对,如:给数字加了下标,对一维数组加了 ...
- python类型错误:'NoneType' object is not subscriptable
TypeError: 'NoneType' object is not subscriptable --> 原因:变量使用了系统内置的关键字list 解决:重新定义下这个变量
- python Flask :TypeError: 'dict' object is not callable
flask 基于Werkzeug .. @moudule.route('/upload', methods=['GET', 'POST']) def upload_file(): global _fl ...
随机推荐
- 解决homebrew下install时出现的问题
在homebrew下install influxdb时出现error: Error: Failure while executing: git config --local --replace-a ...
- eclipse中SpringBoot的maven项目出现无法解析父类的解决办法
在eclipse中建立SpringBoot的maven项目时,继承父类,添加如下代码: <parent> <groupId>org.springframework.boot&l ...
- 基于servlet的图书管理系统
该项目是Java语言开发的图书管理系统,IDE采用eclipse,技术采用servlet,数据库使用mysql,前端页面采用bootstrap框架,简介美观. 系统具备基础的功能,读者可以注册登录,登 ...
- Java中Jedis连接Linux上的Redis出现connect time out(解决方案)
我的代码: /** * * <p>Title: testJedis</p> * <p>Description: 测试单机版的redis连接(每连接一次构建一个对象) ...
- python根据搜索词下载百度图片
# coding=utf-8 """根据搜索词下载百度图片""" import re import urllib import os def ...
- http响应
1.http响应 2.响应行常见状态码 200 :请求成功. 302 :请求重定向. 当访问网址A时,由于网址A服务器端的拦截器或者其他后端代码处理的原因,会被重定向到网址B. 304 :请求资源没有 ...
- 连环清洁工之特殊任务--java资源如何关闭?
小C是一名特殊的黑客,他专门为黑客提供服务,扫除黑客攻击的痕迹,避免被查到为何人攻击. 今天他正兴致勃勃的玩游戏<连环清洁工>,连环清洁工是由iFun4all S.A.制作发行的一款犯罪题 ...
- 005:CSS三大重点之三:定位
目录 1:定位模式和边偏移 2:定位模式 静态定位 相对定位:移动位置:脱标.占位置 绝对定位:脱标.占有位置. 拼爹型 子绝父相 固定定位:脱标.占有位置. 3:定位模式转换 3:z-index 前 ...
- Apache Hadoop集群安装(NameNode HA + YARN HA + SPARK + 机架感知)
1.主机规划 序号 主机名 IP地址 角色 1 nn-1 192.168.9.21 NameNode.mr-jobhistory.zookeeper.JournalNode 2 nn-2 192.16 ...
- OpenGL在ubuntu下的成功配置
sudo apt-get update sudo apt-get install build-essential sudo apt-get install libgl1-mesa-dev sudo a ...