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

LibreOffice 6 doesn't have internal python binary? #454

Open
MartinPaulEve opened this Issue Jun 24, 2018 · 13 comments

Comments

Projects
None yet
3 participants
@MartinPaulEve
Copy link

MartinPaulEve commented Jun 24, 2018

Hi,
I'm getting the familiar "unoconv: Cannot find a suitable pyuno library and python binary combination in /usr/lib/libreoffice" and have tracked it down to there being no python or python.bin file anywhere within my LibreOffice 6 installation. Is this a change to the way that python is handled in LO6 that would break unoconv?
Martin

@AlmogBaku

This comment has been minimized.

Copy link

AlmogBaku commented Nov 21, 2018

any update?

@regebro

This comment has been minimized.

Copy link
Collaborator

regebro commented Feb 15, 2019

No, many system distributions of Libreoffice will not have an included python, but use the system python, so that would be /usr/bin/python3 in this case.

@regebro regebro closed this Feb 15, 2019

@MartinPaulEve

This comment has been minimized.

Copy link
Author

MartinPaulEve commented Feb 15, 2019

Yeah, but @regebro, that simply doesn't work, say on the default install of Ubuntu. Changing the #! to /usr/bin/python3 just results in the ERROR: No module named 'base' error.

@regebro

This comment has been minimized.

Copy link
Collaborator

regebro commented Feb 16, 2019

Hm. That's strange.

@regebro regebro reopened this Feb 16, 2019

@MartinPaulEve

This comment has been minimized.

Copy link
Author

MartinPaulEve commented Feb 17, 2019

Yeah - I've had no success on any Ubuntu 18.04 machine, regardless of which python binary I use.

@regebro

This comment has been minimized.

Copy link
Collaborator

regebro commented Feb 18, 2019

Is python3-uno installed? It's a requirement of Libreoffice, but it seems like it's not a hard requirement, so possibly it's possible to have Libreoffice installed without it?

Also, theoretically, there could be another version of the uno package installed in the Python search path that messes things up.

Try this: python3 -c "import uno; print(uno.__file__)"

It should output /usr/lib/python3/dist-packages/uno.py

@MartinPaulEve

This comment has been minimized.

Copy link
Author

MartinPaulEve commented Feb 18, 2019

Thanks for the reply.

OK, so python3-uno is installed via apt:

sudo apt install python3-uno [sudo] password for martin: Reading package lists... Done Building dependency tree Reading state information... Done python3-uno is already the newest version (1:6.0.7-0ubuntu0.18.04.2).

However, running the import yields:

python3 -c "import uno; print(uno.__file__)" Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/local/lib/python3.6/dist-packages/uno/__init__.py", line 4, in <module> from base import Element, Css, Payload, UnoBaseFeature, UnoBaseField ModuleNotFoundError: No module named 'base'

@regebro

This comment has been minimized.

Copy link
Collaborator

regebro commented Feb 18, 2019

Aha! I also had that problem. It's because I at some time ran "pip install uno". That, unfortunately, downloads and install an HTML converter also called uno.

pip uninstall uno should deal with that.

@MartinPaulEve

This comment has been minimized.

Copy link
Author

MartinPaulEve commented Feb 18, 2019

OK, so I did a pip uninstall uno, both system-wide and inside the virtualenv. This was installed. I then did an apt --reinstall of python3-uno.

In system:

python3 -c "import uno; print(uno.__file__)"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.6/dist-packages/uno/__init__.py", line 4, in <module>
    from base import Element, Css, Payload, UnoBaseFeature, UnoBaseField
ModuleNotFoundError: No module named 'base'

In virtualenv:

python3 -c "import uno; print(uno.__file__)"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'uno'

Thanks for the advice debugging this. Would be great to track it down and write up the pitfalls to avoid.

@regebro

This comment has been minimized.

Copy link
Collaborator

regebro commented Feb 18, 2019

Yeah, I'll leave this open with a Documentation tag.

@MartinPaulEve

This comment has been minimized.

Copy link
Author

MartinPaulEve commented Feb 18, 2019

Thanks for all your work here. Do let me know if there are other things I should test as I'd love to get this working but am still in breakage :(

@regebro

This comment has been minimized.

Copy link
Collaborator

regebro commented Feb 18, 2019

No, you seem to still have the uno module locally, so try deleting the whole /usr/local/lib/python3.6/dist-packages/uno/ directory.

To make a virtualenv with uno you need to point it to the correct Python exe and have the --system-site-packages flag. This worked for me:

virtualenv -p /usr/bin/python3 --system-site-packages withuno

@MartinPaulEve

This comment has been minimized.

Copy link
Author

MartinPaulEve commented Feb 18, 2019

Oh brilliant! I got it. I had to uninstall using pip3 as the standard pip install was a 2.7 install.

Thank you so much for taking the time here!

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