Description: We have just updated to LibreOffice 6.4.6.2 40(Build:2), and now Python’s modules fail to import: $ PYTHONPATH=/usr/lib64/libreoffice/program/ python3.8 Python 3.8.5 (default, Aug 21 2020, 13:17:56) [GCC 9.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import uno >>> from com.sun.star.text import ReferenceFieldSource Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/libreoffice/program/uno.py", line 436, in _uno_import raise uno_import_exc File "/usr/lib64/libreoffice/program/uno.py", line 358, in _uno_import return _builtin_import(name, *optargs, **kwargs) ImportError: No module named 'com' (or 'com.sun.star.text.ReferenceFieldSource' is unknown) >>> Same with Python 3.7. Now rolling back to 6.4.5.2 which hopefully fixes the issue. Is this a regression? Something I’m missing? Anything changed here? I noticed that 6.4.6.2 is not listed below as an “official” release? Steps to Reproduce: See above. Actual Results: Python import exception. Expected Results: Successful import of Python modules. Reproducible: Always User Profile Reset: Yes Additional Info: Built LO on a Gentoo box: [ebuild R ] app-office/libreoffice-6.4.6.2::gentoo USE="dbus mariadb postgres -accessibility -base -bluetooth -branding -coinmp -cups -debug -eds -firebird -googledrive -gstreamer -gtk -java -kde -ldap -odk -pdfimport -test" LIBREOFFICE_EXTENSIONS="-nlpsolver -scripting-beanshell -scripting-javascript -wiki-publisher" PYTHON_SINGLE_TARGET="python3_7 -python3_6 -python3_8 -python3_9" 0 KiB
I do not reproduce with the libreoffice version in Fedora 32's repo. Is it a problem in Gentoo's build of libreoffice?
I do reproduce with version 6.4.6.2 release and also on libreoffice-7-0 branch, when running: from com.sun.star.text import ReferenceFieldSource. The first import, "import uno" is successful.
The import of com.sun.start.* is successful when I use the python shell with the following extension: https://extensions.libreoffice.org/en/extensions/show/apso-alternative-script-organizer-for-python
On pc Debian x86-64 with master sources updated today, I don't reproduce this. Python 3.8.12 (default, Jan 22 2022, 17:24:40) [Clang 13.0.1 ] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import uno >>> from com.sun.star.text import ReferenceFieldSource >>> Debian testing provides LO 7.3.0.2, I don't see any Python binary in a "libreoffice" subdir in "/usr" so can't test it.
@Julien Nabet the python-interpreter on Debian (also linked to LO ) is: /usr/bin/python