Technology and Software

LibreOffice, Python3 and AttributeError: ‘NoneType’ object has no attribute ‘supportsService’

I had to run a modified version of the famous DocumentConverter.py script on Ubuntu 14.04. It run on 12.04 well but Ubuntu 14.04 comes with Python3 and the Uno library to interface Python with LibreOffice or OpenOffice doesn’t work.

Solution: convert the script to Python3 (exceptions, print, has_key have been changed) then install these libraries:

sudo apt-get install libreoffice-dev libreoffice-script-provider-python python3-uno

and the program will work. If you fail to install them you’ll get the AttributeError: ‘NoneType’ object has no attribute ‘supportsService’ error because loadComponentFromURL won’t be able to read the input file.

Advertisement
Standard

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s