Pycharm使用xlwt时,报错的解决方法
来源:互联网 发布:java stringbuffer方法 编辑:程序博客网 时间:2024/06/07 14:41
Traceback (most recent call last):
File "E:/Python-1704/python/day15/10-excel自动化办公/10-4-写入xls文件.py", line 30, in <module>
"表2": [[11, 22, 33], [44, 55, 66], [77, 88, 99]]})
File "E:/Python-1704/python/day15/10-excel自动化办公/10-4-写入xls文件.py", line 25, in makeExcelFile
save_data(path, dic)
File "C:\Users\yangyangyang\AppData\Local\Programs\Python\Python36\lib\site-packages\pyexcel_xls\__init__.py", line 39, in save_data
write_data(afile, data, file_type=file_type, **keywords)
File "C:\Users\yangyangyang\AppData\Local\Programs\Python\Python36\lib\site-packages\pyexcel_io\io.py", line 140, in store_data
with get_writer(**keywords) as writer:
File "C:\Users\yangyangyang\AppData\Local\Programs\Python\Python36\lib\site-packages\pyexcel_io\io.py", line 213, in get_writer
writer = WRITERS.get_a_plugin(file_type, library)
File "C:\Users\yangyangyang\AppData\Local\Programs\Python\Python36\lib\site-packages\pyexcel_io\plugins.py", line 77, in get_a_plugin
plugin = self.load_me_now(__file_type, library=library)
File "C:\Users\yangyangyang\AppData\Local\Programs\Python\Python36\lib\site-packages\lml\plugin.py", line 275, in load_me_now
cls = self.dynamic_load_library(plugin_info)
File "C:\Users\yangyangyang\AppData\Local\Programs\Python\Python36\lib\site-packages\lml\plugin.py", line 303, in dynamic_load_library
cls = do_import_class(a_plugin_info.absolute_import_path)
File "C:\Users\yangyangyang\AppData\Local\Programs\Python\Python36\lib\site-packages\lml\utils.py", line 59, in do_import_class
plugin_module = __import__(plugin_module_name)
File "C:\Users\yangyangyang\AppData\Local\Programs\Python\Python36\lib\site-packages\pyexcel_xls\xlsw.py", line 12, in <module>
from xlwt import Workbook, XFStyle
File "C:\Users\yangyangyang\AppData\Local\Programs\Python\Python36\lib\site-packages\xlwt\__init__.py", line 5, in <module>
from .Row import Row
File "C:\Users\yangyangyang\AppData\Local\Programs\Python\Python36\lib\site-packages\xlwt\Row.py", line 9, in <module>
from . import ExcelFormula
File "C:\Users\yangyangyang\AppData\Local\Programs\Python\Python36\lib\site-packages\xlwt\ExcelFormula.py", line 8, in <module>
from . import ExcelFormulaParser, ExcelFormulaLexer
File "C:\Users\yangyangyang\AppData\Local\Programs\Python\Python36\lib\site-packages\xlwt\ExcelFormulaLexer.py", line 55, in <module>
VERBOSE+LOCALE+IGNORECASE)
File "C:\Users\yangyangyang\AppData\Local\Programs\Python\Python36\lib\re.py", line 233, in compile
return _compile(pattern, flags)
File "C:\Users\yangyangyang\AppData\Local\Programs\Python\Python36\lib\re.py", line 301, in _compile
p = sre_compile.compile(pattern, flags)
File "C:\Users\yangyangyang\AppData\Local\Programs\Python\Python36\lib\sre_compile.py", line 562, in compile
p = sre_parse.parse(p, flags)
File "C:\Users\yangyangyang\AppData\Local\Programs\Python\Python36\lib\sre_parse.py", line 866, in parse
p.pattern.flags = fix_flags(str, p.pattern.flags)
File "C:\Users\yangyangyang\AppData\Local\Programs\Python\Python36\lib\sre_parse.py", line 833, in fix_flags
raise ValueError("cannot use LOCALE flag with a str pattern")
ValueError: cannot use LOCALE flag with a str pattern
解决办法:
在我的电脑里面搜索sre_parse.py
进入此文件,找到以下的一句代码
将它改成如下:
这样写xls文件时就不会报错了
阅读全文
1 0
- Pycharm使用xlwt时,报错的解决方法
- PyCharm使用中文注释报错的解决办法
- xlrd与xlwt的使用
- python3.6 xlwt 安装报错解决
- BoundChecker使用报错的解决方法
- 使用 Statspack报错的解决方法
- 使用Guava报错NoSuchMethodError的解决方法
- 使用Guava报错NoSuchMethodError的解决方法
- pycharm报错
- python->xlwt,xlrd,模块的使用
- python+selenium在Pycharm中使用alert报错问题解决
- 报错的解决方法
- DropDownList使用报错解决方法
- 使用esapi报错解决方法
- 使用eclipse时在jsp中使用el表达式报错的解决方法
- Pycharm中不支持中文编码的解决方案。Pycharm中文报错。
- Pycharm中不支持中文编码的解决方案。Pycharm中文报错。
- 关于pycharm加在caffe模块报错的解决办法
- 牛客网华为在线训练---明明的随机数
- hdu 2066 一个人的旅行(Dijkstra)
- 关于const
- Day23
- 两个网格的近似误差估计
- Pycharm使用xlwt时,报错的解决方法
- Amphiphilic Carbon Molecules UVA
- Gulp学习笔记
- Sticks Problem
- 解题报告:CROC 2016
- Day24
- Python记录记录(进程与线程多任务管理理论)
- text-align属性实际上是可以对内联元素的位置起作用
- Deal or No Deal? End-to-End Learning for Negotiation Dialogues学习笔记