今天在搭建驱动数据框架用到了一个叫 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的问题和解决方案的更多相关文章

  1. openpyxl使用sheet.rows或sheet.columns报TypeError: 'generator' object is not subscriptable解决方式

    解决方案: 因为新版本的openpyxl使用rows或者columns返回一个生成器所以可以使用List来解决报错问题 >>> sheet.columns[0] Traceback ...

  2. Debug 路漫漫-11:Python: TypeError: 'generator' object is not subscriptable

    调试程序,出现以下错误: Python: TypeError: 'generator' object is not subscriptable “在Python中,这种一边循环一边计算的机制,称为生成 ...

  3. TypeError: 'generator' object is not subscriptable

    TypeError: 'generator' object is not subscriptable 生成器对象不可以带下标 def get_row(self,row_no): if not isin ...

  4. python: "TypeError: 'type' object is not subscriptable"

    目前stackoverflow找到两种情况的解决办法: 1.TypeError: 'type' object is not subscriptable when indexing in to a di ...

  5. TypeError: 'NoneType' object is not subscriptable

    运行,显示TypeError: 'NoneType' object is not subscriptable错误信息,原因是变量使用了系统内置的关键字list 重新定义下这个变量就好了

  6. python报错:TypeError: 'int' object is not subscriptable

    检查一遍报错的所在行,此报错一般是在整数上加了下标: 比如:   a = 4   c=a[2] 报错:line 2, in <module>    c=a[2] TypeError: 'i ...

  7. python报以下错误:TypeError: 'int' object is not subscriptable

    原因:数组忘了写下标,数组某项赋值成了 数组对象=数字: 查询其它人的博客,发现仍有其它可能引发此错误,无非是不可以相互操作的对象进行了操作或者是访问对象的方式不对,如:给数字加了下标,对一维数组加了 ...

  8. python类型错误:'NoneType' object is not subscriptable

    TypeError: 'NoneType' object is not subscriptable --> 原因:变量使用了系统内置的关键字list 解决:重新定义下这个变量

  9. python Flask :TypeError: 'dict' object is not callable

    flask 基于Werkzeug .. @moudule.route('/upload', methods=['GET', 'POST']) def upload_file(): global _fl ...

随机推荐

  1. Swift从入门到精通第八篇 - 方法 初识

    方法(学习笔记) 环境Xcode 11.0 beta4 swift 5.1 方法 结构体.枚举.类都可以定义方法(实例方法.类型方法) 实例方法(Instance Methods) 实例方法只能用实例 ...

  2. js-DOM ~ 05. Date日期的相关操作、string、查字符串的位置、给索引查字符、字符串截取slice/substr/substring、去除空格、替换、大小写、Math函数、事件绑定、this

    内置对象:  语言自带的对象/提供了常用的.基本的功能 打印数组和字符串不用for... in   /   打印josn的时候采用for...in Date 获取当前事件:   var date = ...

  3. 解决The mysql extension is deprecated and will be removed

    今天打开网站突然发现报错:“PHP Deprecated:  mysql_connect(): The mysql extension is deprecated and will be remove ...

  4. PB级数据实现秒级查询ES的安装

    什么是ES?ElasticSearch是一个基于Lucene的搜索服务器.它提供了一个分布式多用户能力的全文搜索引擎,基于RESTful web接口.Elasticsearch是用Java语言开发的, ...

  5. Linux防火墙管理

    1.临时关闭防火墙 systemctl stop firewalld 2.查看防火墙运行状态 firewall-cmd --state 3.开启防火墙 systemctl start firewall ...

  6. valueForKey与valueForKeyPath 区别

    1.删除数组中重复的数据 2.valueForKeyPath:可以深层次取到子属性,不管隐藏的多深  valueForKey:无法取到深层次子属性 但是也有其相似的地方: 比如:快速找到字典数组中ke ...

  7. Ubuntu16.4安装Vivado Design Suite sdx2019.1

    1:下载安装包.到Xilinx官网下载下面为网址: https://www.xilinx.com/support/download.html 2:进入安装包路径,打开终端 Ctrl+alt +t sh ...

  8. Cookie的应用——Servlet实现三天免登录

    1.工程结构: 2.Servlet的运用: (1)登录界面: protected void doGet(HttpServletRequest request, HttpServletResponse ...

  9. Cabloy全栈JS框架微创新之一:不一样的“移动优先 PC适配”

    前言 目前流行的前端UI组件库都支持移动设备优先的响应式布局特性.但基于Mobile和PC两个场景的不同用户体验,也往往会实现Mobile和PC两个版本. PC场景下的Web工程,如大量的后台前端管理 ...

  10. Vue学习之vue属性绑定和双向数据绑定

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...