pyexcel/openpyxl __init __()得到了意外的关键字参数错误 [英] pyexcel / openpyxl __init__() got an unexpected keyword argument ERROR

查看:285
本文介绍了pyexcel/openpyxl __init __()得到了意外的关键字参数错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试将文件上传回我们的应用程序时,我收到以下错误堆栈.该应用程序采用xlsx工作表,并且能够对其进行解析并将内容上传回SalesForce.我对这个问题做了一些深入的研究,似乎在兼容性方面可能与openpyxl有关,但我不确定100%.似乎其他人也有此问题,但似乎未列出任何解决方案.还有其他人遇到过这个问题吗?

I am receiving the following error stack when attempting to upload files back to our application. The application takes xlsx sheets and is able to parse them and upload the content back up to SalesForce. I did some digging into this issue and it appears it might be something to do with openpyxl in terms of compatibility but I am not 100% sure. It appears others have had this issue as well but It doesn't appear to be any solutions listed. Has anyone else encountered this problem?

1707版的load_workbook错误excel& pip安装/升级错误openpyxl

https://bitbucket.org/openpyxl/openpyxl/issues/636/error-when-loading-outlookcom-web-excel

 Traceback (most recent call last):
   File "/usr/lib/python2.6/site-packages/flask/app.py", line 1817, in wsgi_app
     response = self.full_dispatch_request()
   File "/usr/lib/python2.6/site-packages/flask/app.py", line 1477, in full_dispatch_request
     rv = self.handle_user_exception(e)
   File "/usr/lib/python2.6/site-packages/flask/app.py", line 1381, in handle_user_exception
     reraise(exc_type, exc_value, tb)
   File "/usr/lib/python2.6/site-packages/flask/app.py", line 1475, in full_dispatch_request
     rv = self.dispatch_request()
   File "/usr/lib/python2.6/site-packages/flask/app.py", line 1461, in dispatch_request
     return self.view_functions[rule.endpoint](**req.view_args)
   File "/var/www/html/nurfi/run.py", line 139, in upload_file
     responses = upload_nurfi_files(files_to_upload)
   File "/var/www/html/nurfi/nurfinstein.py", line 134, in upload_nurfi_files
     statuses[filename] = upload_sheet(file_, sf, verbose_mode = False )
   File "/var/www/html/nurfi/nurfi_app/upload/upload_nurfi.py", line 74, in upload_sheet
     book_dict = pyexcel.get_book_dict(file_name = workbook_name)
   File "/usr/lib/python2.6/dist-packages/pyexcel/core.py", line 343, in get_book_dict
     book = get_book(**keywords)
   File "/usr/lib/python2.6/dist-packages/pyexcel/core.py", line 118, in get_book
     book_stream = _get_book(**keywords)
   File "/usr/lib/python2.6/dist-packages/pyexcel/core.py", line 137, in _get_book
     sheets = source.get_data()
   File "/usr/lib/python2.6/dist-packages/pyexcel/sources/file_source_input.py", line 52, in get_data
     sheets = get_data(self.file_name, streaming=True, **self.keywords)
   File "/usr/lib/python2.6/dist-packages/pyexcel_io/io.py", line 31, in get_data
     file_type=file_type, **keywords)
   File "/usr/lib/python2.6/dist-packages/pyexcel_io/io.py", line 120, in load_data_new
     reader.open(file_name, **keywords)
   File "/usr/lib/python2.6/dist-packages/pyexcel_xlsx/xlsx.py", line 87, in open
     self._load_from_file()
   File "/usr/lib/python2.6/dist-packages/pyexcel_xlsx/xlsx.py", line 127, in _load_from_file
     data_only=True)
   File "/usr/lib/python2.6/dist-packages/openpyxl/reader/excel.py", line 234, in load_workbook
     parser.parse()
   File "/usr/lib/python2.6/dist-packages/openpyxl/reader/worksheet.py", line 106, in parse
     dispatcher[tag_name](element)
   File "/usr/lib/python2.6/dist-packages/openpyxl/reader/worksheet.py", line 295, in parse_data_validation
     dv = DataValidation.from_tree(node)
   File "/usr/lib/python2.6/dist-packages/openpyxl/descriptors/serialisable.py", line 78, in from_tree
     return cls(**attrib)
 TypeError: __init__() got an unexpected keyword argument '{http://schemas.microsoft.com/office/spreadsheetml/2014/revision}uid'

推荐答案

所以希望我的研究时间可以节省一些其他人的时间.似乎可以通过将openpyxl及其依赖插件之一openpyxl_xlsx更新到最新版本来解决此问题.我还建议您是否使用pyexcel将其更新到最新软件包,以及我认为它使用openpyxl作为依赖项.

So hopefully my time digging through this saves some other people some time. It appears that this issue can be resolved by updating openpyxl and one of its plugin dependents openpyxl_xlsx to the latest build. I would also recommend if you are using pyexcel to update that to the latest package as well as I believe it uses openpyxl as a dependent.

sudo pip install openpyxl --upgrade
sudo pip install openpyxl_xlsx --upgrade
sudo pip install pyexcel --upgrade

或针对特定版本...

Or for specific versions...

sudo pip install --upgrade 'package-name'==0.0.0 (Version Number)

这篇关于pyexcel/openpyxl __init __()得到了意外的关键字参数错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆