Build LibreOffice Uno libraries for python3

Issues with installing under all GNU/Linux Distributions
Post Reply
nancy2510
Posts: 2
Joined: Mon Apr 27, 2020 8:12 am

Build LibreOffice Uno libraries for python3

Post by nancy2510 »

I want to use uno libraries to disable some of the menu options in Libreoffice document.

Os Using:
> uname -a
> Linux #1 SMP Tue Feb 4 23:02:59 UTC 2020 x86_64 x86_64 x
86_64 GNU/Linux Red Hat 4.8.5-39
Python version : Python 3.6.8
libreoffice version - LibreOffice 5.3.6.1 30(Build:1)
I am not able to do "import uno" or "import pyuno" in python 3. However both commands are working properly in Python2

Error I am getting in python 3:

Code: Select all

    >>> import pyuno
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ImportError: dynamic module does not define module export function (PyInit_pyuno)
    >>> import uno
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ModuleNotFoundError: No module named 'uno'
Some of the more research which I have done

Code: Select all

    (/usr/lib64/libreoffice/program)-1037> objdump -t -T -r -R pyuno.so | grep initpyuno
    0000000000000a90 g    DF .text  0000000000000117  Base        initpyuno
I think my libreoffice is built against Python 2.x . But I wasnt able to find any solution how to build it against python3.x Thanks in advance.
Last edited by nancy2510 on Tue Apr 28, 2020 6:07 am, edited 4 times in total.
Nancy Garg
Os Using: Linux
Python version : Python 3.6.8
libreoffice version - LibreOffice 5.3.6.1 30(Build:1
User avatar
robleyd
Moderator
Posts: 5056
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Build LibreOffice Uno libraries for python3

Post by robleyd »

Also posted at https://stackoverflow.com/questions/614 ... or-python3

As suggested there, please include the particular flavour of Linux that you are using.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.1.2; SlackBuild for 24.2.1 by Eric Hameleers
nancy2510
Posts: 2
Joined: Mon Apr 27, 2020 8:12 am

Re: Build LibreOffice Uno libraries for python3

Post by nancy2510 »

@robleyd: Done
Nancy Garg
Os Using: Linux
Python version : Python 3.6.8
libreoffice version - LibreOffice 5.3.6.1 30(Build:1
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Build LibreOffice Uno libraries for python3

Post by RoryOF »

As you are using LibreOffice, you may get some LibreOffice specific information from very experienced users by putting your question on
https://ask.libreoffice.org/en/questions/

Please give there links to this and the stackoverflow discussions.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
robleyd
Moderator
Posts: 5056
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Build LibreOffice Uno libraries for python3

Post by robleyd »

I hoped that you would advise here, to save people having to go to Stackoverflow; I note that on that site you have apparently given the kernel version you are using, rather than the particular distribution and version - e.g. Ubuntu 23.6 or ArchLinux 42 or Debian Shrink.

Yes, I know the above are made up versions.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.1.2; SlackBuild for 24.2.1 by Eric Hameleers
Post Reply