load_workbook() got an unexpected keyword argument 'data_only'

1,712 views
Skip to first unread message

ytp...@gmail.com

unread,
Jul 5, 2016, 10:41:17 PM7/5/16
to openpyxl-users
My small python script contains the following statement:

workbook = load_workbook(excelFile, data_only=True)

This statement results following error when executed in ubuntu 14.04:

TypeError: load_workbook() got an unexpected keyword argument 'data_only'

I have to do workbook = load_workbook(excelFile, True) instead.

Here are my openpyxl and python versions:

guest@ca-ivs2:~$ dpkg -s python-openpyxl
Package: python-openpyxl
Status: install ok installed
Priority: optional
Section: python
Installed-Size: 499
Maintainer: Ubuntu Developers <ubuntu-dev...@lists.ubuntu.com>
Architecture: all
Source: openpyxl
Version: 1.7.0+ds1-1
Depends: python (>= 2.6), python-support (>= 0.90.0)
Recommends: python-nose, python-pil, python-imaging
Description: module to read/write OpenXML xlsx/xlsm files
 Openpyxl is a pure Python module to read/write Excel 2007 (OpenXML)
 xlsx/xlsm files.
Original-Maintainer: NeuroDebian Team <te...@neuro.debian.net>
Homepage: http://bitbucket.org/ericgazoni/openpyxl/

guest@ca-ivs2:~$ python --version
Python 2.7.6

Interestingly, I have another ubuntu 14.04 machine with same version of python and openpyxl installed, and the statement works fine.
Can someone tell me what might be the reason or what should I check?
Thanks!


Charlie Clark

unread,
Jul 6, 2016, 2:24:06 AM7/6/16
to openpyx...@googlegroups.com
Am .07.2016, 04:41 Uhr, schrieb <ytp...@gmail.com>:

> Source: openpyxl
> Version: 1.7.0+ds1-1

This is a very old version of openpyxl and doesn't support the "data_only"
keyword.

Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Kronenstr. 27a
Düsseldorf
D- 40217
Tel: +49-211-600-3657
Mobile: +49-178-782-6226

ytp...@gmail.com

unread,
Jul 6, 2016, 1:02:53 PM7/6/16
to openpyxl-users
Thanks for the response, Charlie. I'll upgrade the openpyxl version to solve this problem.
Still, my main question is: the same script works fine in another ubuntu running the same version of openpyxl and python, Any idea what could cause the difference?

Charlie Clark

unread,
Jul 7, 2016, 2:40:32 AM7/7/16
to openpyx...@googlegroups.com
Am .07.2016, 19:02 Uhr, schrieb <ytp...@gmail.com>:

> Still, my main question is: the same script works fine in another ubuntu
> running the same version of openpyxl and python, Any idea what could
> cause the difference?

Only that that can't be the case. FWIW I strongly recommend not using the
system Python on Ubuntu for anything. At the very least setup a virtual
environment for your projects.

Charlie Clark
Reply all
Reply to author
Forward
0 new messages