| Summary: | LibreOffice 24.2.x can't import python binary | ||
|---|---|---|---|
| Product: | LibreOffice | Reporter: | prrvchr |
| Component: | Extensions | Assignee: | Not Assigned <libreoffice-bugs> |
| Status: | NEW --- | ||
| Severity: | normal | CC: | prrvchr |
| Priority: | medium | ||
| Version: | 24.2.1.2 release | ||
| Hardware: | All | ||
| OS: | Linux (All) | ||
| Whiteboard: | |||
| Crash report or crash signature: | Regression By: | ||
|
Description
prrvchr
2024-03-01 18:19:09 UTC
How to reproduce without using the OAuth2OOo extension: The case where it works: - Install LibreOffice 24.2.x on Windows 10 64bits. - download and decompress the lxml package[1] for Windows amd64 / Python 3.8 into a directory. - Place the contents (ie: lxml-5.1.0.dist-info and lxml directory) of this archive in the LibreOffice Python lib directory (ie: C:\Program Files\LibreOffice\program\python-core-3.8.18\lib) - Open a terminal and place this in the folder: C:\Program Files\LibreOffice\program. - Load the Python console with the command: .\python - In the Python console import the lxml and etree modules using the commands: - import lxml - from lxml import etree - The 2 modules will be loaded correctly. The case where it doesn't work: - Install LibreOffice 24.2.x on Linux x86_64. - download and decompress the lxml package[2] for Linux x86_64 / Python 3.8 into a directory. - Place the contents (ie: lxml-5.1.0.dist-info and lxml directory) of this archive in the LibreOffice Python lib directory (ie: /opt/libreoffice24.2/program/python-core-3.8.18/lib) - Open a terminal and place this in the folder: /opt/libreoffice24.2/program. - Load the Python console with the command: ./python - In the Python console import the lxml and etree modules using the commands: - import lxml - from lxml import etree - When you import etree you will get the error: ImportError: cannot import name 'etree' from 'lxml' (/opt/libreoffice24.2/program/python-core-3.8.18/lib/lxml/__init__.py) [1] https://files.pythonhosted.org/packages/86/65/3d582b968b9b6c3efdc4e54f36878d0b79c51af10ec7c9d02d08dd72314b/lxml-5.1.0-cp38-cp38-win_amd64.whl [2] https://files.pythonhosted.org/packages/ee/08/8cb09c9a0d77e7b615ace332a76e6460f4c3b0a50654c181755c619c383e/lxml-5.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Last clarification: this is not necessarily linked to the python lxml package but to the fact that they have binary files since I have the same problem with the ijson, cffi and charser-normalizer packages. I think this additional information will be enough to resolve this problem. - In LibreOffice 24.2.x python console for Windows 10, I get: >>> import distutils.sysconfig as ds >>> print(ds.get_config_var("EXT_SUFFIX")) .cp38-win_amd64.pyd - In LibreOffice 24.2.x python console for Linux, I get: >>> import distutils.sysconfig as ds >>> print(ds.get_config_var("EXT_SUFFIX")) .cpython-3.8.so It turns out that EXT_SUFFIX does not have the correct value which should be: .cpython-38-x86_64-linux-gnu.so Besides, if I rename the binary files under the wrong name I can import them... I do not have the possibility to test under MacOS what about LibreOffice version 24.2. x under OSX? |