Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unoconv: Cannot find a suitable pyuno library and python binary combination #49

Closed
Lakshmipathi opened this issue Apr 23, 2012 · 29 comments

Comments

@Lakshmipathi
Copy link

commented Apr 23, 2012

I did a git clone and running into following error message. I don't have openoffice but I have libreoffice write/calc/Impress installed on my machine. Any thoughts what's the issue? (I'm using Fedora16 and Python-2.7.2)

./unoconv

unoconv: Cannot find a suitable pyuno library and python binary combination in /usr/lib64/libreoffice
ERROR: Please locate this library and send your feedback to:
http://github.com/dagwieers/unoconv/issues
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

@graaff

This comment has been minimized.

Copy link
Contributor

commented Apr 23, 2012

I have the same problem. The paths are determined correctly according to debug_office()

sysname=posix
platform=linux2
python=/usr/bin/python2
python-version=2.7.2 (default, Oct 29 2011, 08:55:35)
[GCC 4.5.3]
URE_BOOTSTRAP=vnd.sun.star.pathname:/usr/lib64/libreoffice/program/fundamentalrc
UNO_PATH=/usr/lib64/libreoffice/program
PATH=/usr/lib64/libreoffice/program:/home/graaff/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.3:/opt/android-sdk-update-manager/tools:/opt/android-sdk-update-manager/platform-tools:/usr/games/bin
LD_LIBRARY_PATH=/usr/lib64/libreoffice/program:/usr/lib64/libreoffice/ure-link/lib
unoconv: Cannot find a suitable pyuno library and python binary combination in /usr/lib64/libreoffice
ERROR: Please locate this library and send your feedback to:
http://github.com/dagwieers/unoconv/issues
No module named uno

uno.py is located in /usr/lib64/libreoffice/program

I fixed this by adding the following line to office_environ()

        sys.path.insert(0, os.path.join(office.basepath, 'program'))
@Lakshmipathi

This comment has been minimized.

Copy link
Author

commented Apr 23, 2012

Hi Graaff,thanks for prompt reply. Where should I add that line in office_environ(). I tried to putting that one as first line and last line ..both didn't work me :(

@dagwieers

This comment has been minimized.

Copy link
Member

commented Apr 23, 2012

@Lakshmipathi Is this with v0.5 that was released last week ? If not, could you test this with v0.5 ?

@graaff unoconv is looking for pyuno.so, not uno.py. And it is looking for this file in it's python sys.path, which is not printed by debug_office(), maybe this is something we could improve. E.g. if it fails to find a working setup, print the information where it was looking. The problem here is that it is trying to be smart by testing various locations and so we cannot assume that if one location fails, this is a problem. Not can we assume that if all locations fail, the last one tested is the cause :-/

@Lakshmipathi

This comment has been minimized.

Copy link
Author

commented Apr 24, 2012

@dagwieers Yes,I'm using v0.5 (commit-id "ba2e85d2c750b0c32501cdc85fad53a8509167c7" / Prepare release v0.5 " )

@dagwieers

This comment has been minimized.

Copy link
Member

commented Apr 24, 2012

@graaff I was wrong, it seems pyuno.so and uno.py are being used while they might reside in different paths, e.g. resp /usr/lib64/openoffice.org/basis3.2/program/pyuno.so and /usr/lib64/python2.6/site-packages/uno.py, so on other platforms we need to be careful to include both and not just expect that the pyuno.so location is sufficient. Bummer :-(

@ghost ghost assigned dagwieers Apr 26, 2012

@dagwieers

This comment has been minimized.

Copy link
Member

commented Apr 26, 2012

@Lakshmipathi I have made a modification so that -vvv is considered debug mode. This way it provides you with a lot of information that might help me track down the problem. It will show what files it finds where. Please download the latest master branch and run your command line with -vvv. Thanks !

@Lakshmipathi

This comment has been minimized.

Copy link
Author

commented Apr 26, 2012

@dagwieers I did git pull now. Ran with debug mode. Here is the output

[root@space unoconv]# ./unoconv --listener -vvv &
[1] 654
[root@space unoconv]# Verbosity set to level 3
DEBUG: sysname=posix, platform=linux2, python=/usr/bin/python, python-version=2.7.2 (default, Oct 27 2011, 01:40:22)
[GCC 4.6.1 20111003 (Red Hat 4.6.1-10)]
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/laks/.local/bin:/home/laks/bin
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

[1]+ Exit 1 ./unoconv --listener -vvv

@dagwieers

This comment has been minimized.

Copy link
Member

commented Apr 26, 2012

Can you provide the location of your LibreOffice installation:

UNO_PATH=/usr/lib64/libreoffice ./unoconv -vvv -f pdf file.odt

What I do not understand is why it does not provide more information in your case. What distribution are you using ?

On my RHEL 6.3 Beta I get this:

[dag@moria unoconv]$ ./unoconv --listener -vvv
Verbosity set to level 3
DEBUG: Found pyuno.so in /usr/lib64/libreoffice/basis-link/program
DEBUG: Found unorc in /usr/lib64/libreoffice/basis-link/ure-link/lib
DEBUG: Found soffice.bin in /usr/lib64/libreoffice/program
DEBUG: Found pyuno.so in /opt/libreoffice/basis-link/program
DEBUG: Found unorc in /opt/libreoffice/basis-link/ure-link/lib
DEBUG: Found soffice.bin in /opt/libreoffice/program
DEBUG: Found pyuno.so in /opt/libreoffice3.4/basis-link/program
DEBUG: Found unorc in /opt/libreoffice3.4/basis-link/ure-link/lib
DEBUG: Found soffice.bin in /opt/libreoffice3.4/program
DEBUG: Found pyuno.so in /opt/libreoffice3.5/program
DEBUG: Found unorc in /opt/libreoffice3.5/ure-link/lib
DEBUG: Found soffice.bin in /opt/libreoffice3.5/program
Start listener on localhost:2002
@Lakshmipathi

This comment has been minimized.

Copy link
Author

commented Apr 26, 2012

I'm using Fedora-16. I tried exporting the path,still gives

[root@space unoconv]# UNOPATH=/usr/lib64/libreoffice ./unoconv -vvv -f pdf file.odt
Verbosity set to level 3
DEBUG: sysname=posix, platform=linux2, python=/usr/bin/python, python-version=2.7.2 (default, Oct 27 2011, 01:40:22)
[GCC 4.6.1 20111003 (Red Hat 4.6.1-10)]
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/laks/.local/bin:/home/laks/bin
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

another try:

[root@space unoconv]# export UNOPATH=/usr/lib64/libreoffice;
[root@space unoconv]# echo $UNOPATH
/usr/lib64/libreoffice
[root@space unoconv]# ./unoconv -vvv -f pdf file.odt
Verbosity set to level 3
DEBUG: sysname=posix, platform=linux2, python=/usr/bin/python, python-version=2.7.2 (default, Oct 27 2011, 01:40:22)
[GCC 4.6.1 20111003 (Red Hat 4.6.1-10)]
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/laks/.local/bin:/home/laks/bin
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

@dagwieers

This comment has been minimized.

Copy link
Member

commented Apr 26, 2012

Is it by any chance possible that you are lacking a proper LibreOffice installation with UNO support ? Normally this is part of your unoconv RPM package dependencies. Did you try to use the official Fedora package by any chance ?

I bet you simply lack the UNO bindings, which on Fedora is in: libreoffice-pyuno

@Lakshmipathi

This comment has been minimized.

Copy link
Author

commented Apr 27, 2012

@dagwieers Yes,you are correct.libreoffice-pyuno was missing from my setup. I didn't install unoconv from Fedora package .I got the source from github and tried to use that. After installing the UNO binding , (yum install libreoffice-pyuno). It worked. Thanks for your help :)

@graaff

This comment has been minimized.

Copy link
Contributor

commented Apr 27, 2012

For reference I'm using libreoffice 3.5.2.2 on Gentoo Linux.

uno.py, unohelper.py, and pyuno.so are located in /usr/lib64/libreoffice/program.

@dagwieers

This comment has been minimized.

Copy link
Member

commented Apr 27, 2012

@Lakshmipathi Thanks for the feedback. I guess I need to update the README to reflect this better.

@graaff AFAIK unoconv should cover this. This is also true for the official LibreOffice RPM packages. If you (still) have problems with unoconv on Gentoo, we should look into it.

@dagwieers dagwieers closed this in c6c0722 Apr 27, 2012

@graaff

This comment has been minimized.

Copy link
Contributor

commented Apr 27, 2012

It doesn't work for me without my hack in comment #4

@dagwieers dagwieers reopened this May 16, 2012

@dagwieers

This comment has been minimized.

Copy link
Member

commented May 16, 2012

@graaff If you have another python installed, running unoconv should work (i.e. it should automatically load the other python and continue). Can you try this using unoconv -vvv and send me the debug output ?

Thanks in advance !

@graaff

This comment has been minimized.

Copy link
Contributor

commented May 19, 2012

I've just tried with master and things now seem to work as expected. I haven't tested on the machine that I originally reported this problem on, but the one I'm on now should have an identical setup. I'll verify on the other machine after the weekend.

Verbosity set to level 3
DEBUG: sysname=posix, platform=linux2, python=/usr/bin/python2.7, python-version=2.7.3 (default, May 16 2012, 18:23:34) 
[GCC 4.5.3]
DEBUG: Found pyuno.so in /usr/lib64/libreoffice/program
DEBUG: Found soffice.bin in /usr/lib64/libreoffice/program
DEBUG: Found unorc in /usr/lib64/libreoffice/ure-link/lib
DEBUG: Considering /usr/lib64/libreoffice
DEBUG: Found pyuno.so in /usr/lib/libreoffice/program
DEBUG: Found soffice.bin in /usr/lib/libreoffice/program
DEBUG: Found unorc in /usr/lib/libreoffice/ure-link/lib
DEBUG: Considering /usr/lib/libreoffice
Using office base path: /usr/lib64/libreoffice
Using office binary path: /usr/lib64/libreoffice/program
DEBUG: Connection type: socket,host=localhost,port=2002;urp;StarOffice.ComponentContext
DEBUG: Existing listener not found.
DEBUG: Launching our own listener using /usr/lib64/libreoffice/program/soffice.bin.
LibreOffice listener successfully started. (pid=13676)
Input file: tests/document-example.odt
Selected output format: Portable Document Format [.pdf]
Selected office filter: writer_pdf_Export
Used doctype: document
Output file: tests/document-example.pdf
DEBUG: Terminating LibreOffice instance.
DEBUG: Waiting for LibreOffice instance to exit.
@dagwieers

This comment has been minimized.

Copy link
Member

commented May 20, 2012

Great to hear. In good faith (I am quite the optimist ;-)) I am closing this issue, feel free to reopen it if you can reproduce this problem with the master branch !

@dagwieers dagwieers closed this May 20, 2012

@jukkagrao

This comment has been minimized.

Copy link

commented Apr 3, 2013

In debian i fix this issue just changed first line to #!/usr/bin/python

@Easthy

This comment has been minimized.

Copy link

commented May 26, 2015

$unoconv --listener &

[1] 26217
$:/var/www/v2/socAgency/branches/testNewBase/app/Console$ 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

My system is Kubuntu 14.04 64bit

sudo apt-get install openjdk-6-jdk libreoffice-core libreoffice-common libreoffice-writer python-uno
Package python-uno is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source
These packages could replace them
libreoffice-script-provider-python

@fungiboletus

This comment has been minimized.

Copy link

commented Jul 21, 2015

@Easthy I had the same error on Ubuntu 14.04 and I fixed the problem by using python3 instead of python.

@sTb1337

This comment has been minimized.

Copy link

commented Aug 31, 2016

I have the same error on Ubuntu 14.04.

sq006wqa01:/usr/bin# export UNOPATH=/usr/bin/libreoffice
sq006wqa01:/usr/bin# echo $UNOPATH
/usr/bin/libreoffice
sq006wqa01:/usr/bin# unoconv -vvv --show
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

@0rdinatus

This comment has been minimized.

Copy link

commented Sep 6, 2016

@sTb1337 Replace first line to #!/usr/bin/env python3 or set default alias python='/usr/bin/python3'

@sTb1337

This comment has been minimized.

Copy link

commented Sep 6, 2016

@0rdinatus Thanks a lot it worked!

@lukaszle

This comment has been minimized.

Copy link

commented Oct 24, 2016

Hi.
I solved this by installing fresh LibreOffice from here:
After unpacking archive run sudo dpkg -i *.deb in DEBS subdirectory to install LibreOffice 5.2.
Default install location is/opt/libreoffice5.2/

Then force using this version by setting UNO_PATH - to run unoconv:
UNO_PATH=/opt/libreoffice5.2 unoconv

lukasz@ubudev:~/CSV$ UNO_PATH=/opt/libreoffice5.2 unoconv


unoconv: you have to provide a filename or url as argument
Try `unoconv -h' for more information.

I noticed package libobasis5.2-pyuno_5.2.2.2-2_amd64.deb in DEBS.
I'm pretty sure that if you will download installer for your LibreOffice version and install this package it will do the job.

@SainteCelery

This comment has been minimized.

Copy link

commented Jul 13, 2017

This bug from 2012 is still a problem. Is there a fix in progress?

@mdkhaledben

This comment has been minimized.

Copy link

commented May 21, 2018

I am facing the same problem on Ubuntu 18.04 in case of $unoconv --show.

My Libreoffice version: Version: 6.0.3.2
Build ID: 1:6.0.3-0ubuntu1

Installed Unoconv package from Repository, version 0.7-1.1

Shebang "#!/usr/bin/env python3" is already exists on "/usr/bin/unoconv" file.

Any known fix or suggestion? Thanks

@stas00

This comment has been minimized.

Copy link

commented Aug 27, 2018

This fixed the same problem for me:

Edit the first line of /usr/bin/unoconv to replace:

#!/usr/bin/env python3

with

#!/usr/bin/python3

I found this fix here.

@regebro

This comment has been minimized.

Copy link
Collaborator

commented Feb 15, 2019

I've noticed that when these issues arise, the solution is to run unoconv with the python executable that comes with the Libreoffice installation you want to use. Like so:

UNOPATH=/path/to/Libreoffice /path/to/Libreoffice/program/python /usr/bin/unoconv ....

Yes, that's fairly annoying, but only happens with multiple LibreOffice and/or Python installations.

@mohammedyunus009

This comment has been minimized.

Copy link

commented Mar 3, 2019

I tried this solution u just need to add in ur terminal URE_BOOTSTRAP=vnd.sun.star.pathname:/usr/lib64/libreoffice/program/fundamentalrc UNO_PATH=/usr/lib64/libreoffice/program PATH=/usr/lib64/libreoffice/program:/home/graaff/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.3:/opt/android-sdk-update-manager/tools:/opt/android-sdk-update-manager/platform-tools:/usr/games/bin , Or even UNO_PATH and PATH would work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.