I have a django app that calls unoconv using subprocess. It works fine when I run in my development environment, but errors out when run in the production environment.
It gives this error
"unoconv: Cannot find a suitable pyuno library and python binary combination in /usr/lib/libreoffice ERROR: No module named uno
unoconv: Cannot find a suitable office installation on your system. ERROR: Please locate your office installation and send your feedback to: http://github.com/dagwieers/unoconv/issues"
But unoconv runs just fine from the command line.
Since I run the django app as a uwsgi vassal, it might have something to do with privileges, though for the life of me I can't figure out how to fix it.
PS - The django app does not start a unoconv listener, there one already running.
EDIT - It wasn't a permissions issue rather, but a path issue as unoconv was being called from the wrong python interpreter(the virtualenv one)
Since the app is running in an virtualenv, unoconv is being called with the virtualenv python interpreter instead of the system one.
The fix is pretty simple if you have virtualenvwrapper - just call the add2virtualenv
command with the path to the directory containing uno.py
and unohelper.py
as the argument (/usr/share/pyshared
) in my case.