Build LibreOffice Uno libraries for python3

Issues with installing under all Linux Distributions

Build LibreOffice Uno libraries for python3

Postby nancy2510 » Mon Apr 27, 2020 8:17 am

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   Expand viewCollapse view
    >>> 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   Expand viewCollapse view
    (/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
nancy2510
 
Posts: 2
Joined: Mon Apr 27, 2020 8:12 am

Re: Build LibreOffice Uno libraries for python3

Postby robleyd » Mon Apr 27, 2020 10:29 am

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
Apache OpenOffice 420m2(Build:9821) - Slackware 14.2 - 64 bit
LibreOffice 6.0.7.3 - Slackware 14.2 - 64 bit
Apache OpenOffice 4.1.4 - Windows 7 Virtual machine
User avatar
robleyd
Moderator
 
Posts: 3508
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Build LibreOffice Uno libraries for python3

Postby nancy2510 » Mon Apr 27, 2020 10:33 am

@robleyd: Done
Nancy Garg
Os Using: Linux
Python version : Python 3.6.8
libreoffice version - LibreOffice 5.3.6.1 30(Build:1
nancy2510
 
Posts: 2
Joined: Mon Apr 27, 2020 8:12 am

Re: Build LibreOffice Uno libraries for python3

Postby RoryOF » Mon Apr 27, 2020 10:40 am

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.7 on Xubuntu 20.04.1 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 31535
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Build LibreOffice Uno libraries for python3

Postby robleyd » Mon Apr 27, 2020 10:43 am

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
Apache OpenOffice 420m2(Build:9821) - Slackware 14.2 - 64 bit
LibreOffice 6.0.7.3 - Slackware 14.2 - 64 bit
Apache OpenOffice 4.1.4 - Windows 7 Virtual machine
User avatar
robleyd
Moderator
 
Posts: 3508
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia


Return to Linux

Who is online

Users browsing this forum: No registered users and 4 guests