Python pptx unexpected keyword argument 'standalone'
Question: I try to run example of pptx- version 0.5.1 in Python 2.6.8. The code is
simple

    
    
    from pptx import Presentation
    
    prs = Presentation()
    prs.save('test.pptx')
    

But I get the error "got an unexpected keyword argument 'standalone' ":

> Traceback (most recent call last): File "prez.py", line 4, in
>  
>  
>     prs.save('test.pptx')   File "/usr/local/lib64/python2.6/site-
> packages/python_pptx-0.5.1-py2.6.egg/pptx/api.py",
>  
>
> line 132, in save
>  
>  
>     return self._package.save(file)   File "/usr/local/lib64/python2.6/site-
> packages/python_pptx-0.5.1-py2.6.egg/pptx/opc/package.py",
>  
>
> line 144, in save PackageWriter.write(pkg_file, self.rels, self.parts) File
> "/usr/local/lib64/python2.6/site-
> packages/python_pptx-0.5.1-py2.6.egg/pptx/opc/pkgwriter.py",
>
> line 33, in write
>  
>  
>     PackageWriter._write_content_types_stream(phys_writer, parts)   File
>  
>
> "/usr/local/lib64/python2.6/site-
> packages/python_pptx-0.5.1-py2.6.egg/pptx/opc/pkgwriter.py",
>
> line 45, in _write_content_types_stream
>  
>  
>     _ContentTypesItem.xml_for(parts)   File
> "/usr/local/lib64/python2.6/site-
> packages/python_pptx-0.5.1-py2.6.egg/pptx/opc/oxml.py",
>  
>
> line 39, in serialize_part_xml
>  
>  
>     xml = etree.tostring(part_elm, encoding='UTF-8', standalone=True)   File
> "lxml.etree.pyx", line 2471, in lxml.etree.tostring
>  
>
> (src/lxml/lxml.etree.c:24624) TypeError: tostring() got an unexpected
>
> keyword argument 'standalone'

I have no idea what is incorrect. All examples from documentation reports the
same error when I try to save the presentation.


Answer: The problem was with some libraries which were out of date.

