How do you install or activate PyUno in LibreOffice?
Asked Answered
O

6

10

How do you make Python (any Python) know about PyUno in LibreOffice?

When I do:

import uno

python says that it knows no module "uno". (This question came up re. this question.)

Osmo answered 16/10, 2011 at 13:2 Comment(3)
Please be more specific. How exactly did you install PyUno? And where? What's your sys.path? ...Heliotrope
related: Python 2.7 with pyunoRafaelita
See below updating for 2014's.Zaneta
O
0

Here's what I did:

inside the LibreOffice directory, there is a "program" directory with a python.exe, if I use that python (which is at version 2.6.1), I can import uno.

Osmo answered 16/10, 2011 at 13:58 Comment(3)
This is not a solution to your question. It's just a workaround.Chaw
It seems to me that using the built-in Python (as of LibreOffice4 and Python 3.3) is the only option here. I have a very hard time finding out how I can install pyuno for my working Python environment...Cyanohydrin
@Clark, with some tweaking and working around the lack of other packages it worked for me too, it's just a bit of an annoyance to be constrained by that. Having said that, I did not try to re-install the packages for LO-Python. Would be nice if pyuno was provided as a PIP package...Cyanohydrin
Z
5

(UPDATING for 2014's)

Perhaps the most used UNO application is document conversion... For this task, in nowadays, you not need UNO, you can use directly

libreoffice --convert-to

About UNO itself, see the new home page, http://api.libreoffice.org/

A good example of using python3-uno (or python-uno) is the Docvert conversor (Docvert for py2).

Zaneta answered 29/10, 2014 at 12:30 Comment(1)
This answer saved me a huge amount of time debugging endless issues with unoconv.Kibbutznik
K
5

For Debian, Ubuntu, and derivates:

sudo apt install libreoffice-script-provider-python
Kansas answered 18/10, 2021 at 6:0 Comment(0)
E
2

As said in the response to your comment there: it's an optional installable component for OpenOffice. See the Introduction to Python on OOo page in OpenOffice's Wiki for installation details

Evidence answered 16/10, 2011 at 13:51 Comment(0)
F
2

I am having the same issue with ubuntu 14.04 and python 2.7.6.

But if you are using ubuntu 12.04, try using sudo apt-get install python-uno.

Fernandafernande answered 15/5, 2014 at 11:1 Comment(2)
N!ce one, sir. Need to add that this days it's the package libreoffice-script-provider-pythonSudduth
For ubuntu 16.04 the required package is called python3-unoBoondocks
O
0

Here's what I did:

inside the LibreOffice directory, there is a "program" directory with a python.exe, if I use that python (which is at version 2.6.1), I can import uno.

Osmo answered 16/10, 2011 at 13:58 Comment(3)
This is not a solution to your question. It's just a workaround.Chaw
It seems to me that using the built-in Python (as of LibreOffice4 and Python 3.3) is the only option here. I have a very hard time finding out how I can install pyuno for my working Python environment...Cyanohydrin
@Clark, with some tweaking and working around the lack of other packages it worked for me too, it's just a bit of an annoyance to be constrained by that. Having said that, I did not try to re-install the packages for LO-Python. Would be nice if pyuno was provided as a PIP package...Cyanohydrin
H
-1

Try importing the libre office python extension.

yum install libreoffice-pyuno

Heist answered 15/8, 2018 at 4:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.