Having a problem with saving

4,326 views
Skip to first unread message

Phil Woodworth

unread,
Jul 27, 2011, 3:39:05 PM7/27/11
to openpyxl-users
I'm actually quite impressed with how well this works, I'll be using
it quite heavily to do some data mining. Problem:

>>> from openpyxl.workbook import Workbook
>>> from openpyxl.reader.excel import load_workbook
>>> wb1 = load_workbook('MagReplacement to Install 4.0.4 SW.xlsx')
>>> wb1.save('test.xlsx')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'Workbook' object has no attribute 'save'
>>>

I wouldn't be surprised if I was doing something wrong. I'm following
the tutorial:

http://packages.python.org/openpyxl/tutorial.html

Any help would be appreciated.

Thanks

Eric Gazoni

unread,
Jul 27, 2011, 3:51:41 PM7/27/11
to openpyx...@googlegroups.com
Hi Phil,
nice to hear it works for you :)

Could you just give me which version of openpyxl you're using ? The
save() method is not present on old releases. To be sure, just print
"openpyxl.__version__".

Thanks,
Eric

Le 27/07/11 21:39, Phil Woodworth a �crit :

Phil Woodworth

unread,
Jul 27, 2011, 4:29:33 PM7/27/11
to openpyx...@googlegroups.com

__major__ = 1       # for major interface/format changes
__minor__ = 1       # for minor interface/format changes
__release__ = 0     # for tweaks, bug-fixes, or development

__version__ = '%d.%d.%d' % (__major__,
                            __minor__,
                            __release__)

On Wed, Jul 27, 2011 at 2:51 PM, Eric Gazoni <eric....@gmail.com> wrote:
Hi Phil,
nice to hear it works for you :)

Could you just give me which version of openpyxl you're using ? The
save() method is not present on old releases. To be sure, just print
"openpyxl.__version__".

Thanks,
Eric

Le 27/07/11 21:39, Phil Woodworth a écrit :

Phil Woodworth

unread,
Jul 27, 2011, 4:33:04 PM7/27/11
to openpyx...@googlegroups.com
I was going to mention that under:
 
\openpyxl\writer\excel.py
 
"save" is defined there.
 
Anyway, if there is newer version, please point me to it.
 
Thanks,
 
Phil 

On Wed, Jul 27, 2011 at 2:51 PM, Eric Gazoni <eric....@gmail.com> wrote:
Hi Phil,
nice to hear it works for you :)

Could you just give me which version of openpyxl you're using ? The
save() method is not present on old releases. To be sure, just print
"openpyxl.__version__".

Thanks,
Eric

Le 27/07/11 21:39, Phil Woodworth a écrit :

Eric Gazoni

unread,
Jul 27, 2011, 4:38:24 PM7/27/11
to openpyx...@googlegroups.com
You've got the 1.1.0 version, save() might not work properly at that
point. You can get the latest version by using "easy_install -U
openpyxl" or download a new version from
https://bitbucket.org/ericgazoni/openpyxl/get/tip.zip

Let me know if that works better. On a side note, if you're doing
serious data mining, I suggest you have a look at the optimized reader
described here : http://packages.python.org/openpyxl/optimized.html
which is only available since version 1.5.

Cheers,
Eric

Le 27/07/11 22:33, Phil Woodworth a �crit :


> I was going to mention that under:
>
> \openpyxl\writer\excel.py
>
> "save" is defined there.
>
> Anyway, if there is newer version, please point me to it.
>
> Thanks,
>
> Phil
>
> On Wed, Jul 27, 2011 at 2:51 PM, Eric Gazoni <eric....@gmail.com> wrote:
>
>> Hi Phil,
>> nice to hear it works for you :)
>>
>> Could you just give me which version of openpyxl you're using ? The
>> save() method is not present on old releases. To be sure, just print
>> "openpyxl.__version__".
>>
>> Thanks,
>> Eric
>>

>> Le 27/07/11 21:39, Phil Woodworth a �crit :

Phil Woodworth

unread,
Jul 27, 2011, 5:08:33 PM7/27/11
to openpyx...@googlegroups.com
Perfect,
 
Thanks

On Wed, Jul 27, 2011 at 3:38 PM, Eric Gazoni <eric....@gmail.com> wrote:
You've got the 1.1.0 version, save() might not work properly at that
point. You can get the latest version by using "easy_install -U
openpyxl" or download a new version from
https://bitbucket.org/ericgazoni/openpyxl/get/tip.zip

Let me know if that works better. On a side note, if you're doing
serious data mining, I suggest you have a look at the optimized reader
described here : http://packages.python.org/openpyxl/optimized.html
which is only available since version 1.5.

Cheers,
Eric

Le 27/07/11 22:33, Phil Woodworth a écrit :
> I was going to mention that under:
>
> \openpyxl\writer\excel.py
>
> "save" is defined there.
>
> Anyway, if there is newer version, please point me to it.
>
> Thanks,
>
> Phil
>
> On Wed, Jul 27, 2011 at 2:51 PM, Eric Gazoni <eric....@gmail.com> wrote:
>
>> Hi Phil,
>> nice to hear it works for you :)
>>
>> Could you just give me which version of openpyxl you're using ? The
>> save() method is not present on old releases. To be sure, just print
>> "openpyxl.__version__".
>>
>> Thanks,
>> Eric
>>
>> Le 27/07/11 21:39, Phil Woodworth a écrit :

Phil Woodworth

unread,
Jul 27, 2011, 5:11:25 PM7/27/11
to openpyx...@googlegroups.com
got it, loaded it, worked.
 
Again,
 
Thanks

Eric Gazoni

unread,
Jul 27, 2011, 5:12:48 PM7/27/11
to openpyx...@googlegroups.com
You're welcome :)


Le 27/07/11 23:11, Phil Woodworth a �crit :


> got it, loaded it, worked.
>
> Again,
>
> Thanks
>
> On Wed, Jul 27, 2011 at 4:08 PM, Phil Woodworth <woodm...@gmail.com>wrote:
>
>> Perfect,
>>
>> Thanks
>>
>> On Wed, Jul 27, 2011 at 3:38 PM, Eric Gazoni <eric....@gmail.com>wrote:
>>
>>> You've got the 1.1.0 version, save() might not work properly at that
>>> point. You can get the latest version by using "easy_install -U
>>> openpyxl" or download a new version from
>>> https://bitbucket.org/ericgazoni/openpyxl/get/tip.zip
>>>
>>> Let me know if that works better. On a side note, if you're doing
>>> serious data mining, I suggest you have a look at the optimized reader
>>> described here : http://packages.python.org/openpyxl/optimized.html
>>> which is only available since version 1.5.
>>>
>>> Cheers,
>>> Eric
>>>

>>> Le 27/07/11 22:33, Phil Woodworth a �crit :


>>> > I was going to mention that under:
>>>> \openpyxl\writer\excel.py
>>>>
>>>> "save" is defined there.
>>>>
>>>> Anyway, if there is newer version, please point me to it.
>>>>
>>>> Thanks,
>>>>
>>>> Phil
>>>>
>>>> On Wed, Jul 27, 2011 at 2:51 PM, Eric Gazoni <eric....@gmail.com>
>>> wrote:
>>>>> Hi Phil,
>>>>> nice to hear it works for you :)
>>>>>
>>>>> Could you just give me which version of openpyxl you're using ? The
>>>>> save() method is not present on old releases. To be sure, just print
>>>>> "openpyxl.__version__".
>>>>>
>>>>> Thanks,
>>>>> Eric
>>>>>

>>>>> Le 27/07/11 21:39, Phil Woodworth a �crit :

Reply all
Reply to author
Forward
0 new messages