Introducing New LibrePythonista Extension. The power of python now inside of Calc

Is there any Log data? The log should be at ~/.config/libreoffice/4/user/libre_pythonista.log


Also in the Extension Manager in the Settings for LibrePythonista you can set the Logging to Debug. This outputs a lot of information into the log file that can be very helpful.

The log file in a brand new profile with the extension installed:

2024-10-07 00:23:17,580 - INFO - uno_component: LibrePythonista version 0.3.2 execute starting
2024-10-07 00:23:17,586 - INFO - libre_pythonista.install.requirements_check: Package typing-extensions 4.12.2 already installed. Requirements met for constraints: >=4.12.2
2024-10-07 00:23:17,588 - INFO - libre_pythonista.install.requirements_check: Package verr 1.1.2 already installed. Requirements met for constraints: >=1.1.2
2024-10-07 00:23:17,591 - INFO - libre_pythonista.install.requirements_check: Package pandas 2.0.3 already installed. Requirements met for constraints: >=2
2024-10-07 00:23:17,593 - INFO - libre_pythonista.install.requirements_check: Package odfpy 1.4.1 already installed. Requirements met for constraints: >=1.4
2024-10-07 00:23:17,595 - INFO - libre_pythonista.install.requirements_check: Package ooo-dev-tools 0.47.17 already installed. Requirements met for constraints: >=0.47.17
2024-10-07 00:23:17,597 - INFO - libre_pythonista.install.requirements_check: Package matplotlib 3.7.5 already installed. Requirements met for constraints: >=3.7.5
2024-10-07 00:23:17,599 - INFO - libre_pythonista.install.requirements_check: Package seaborn 0.13.2 already installed. Requirements met for constraints: >=0.13
2024-10-07 00:23:17,602 - INFO - libre_pythonista.install.requirements_check: Package sortedcontainers 2.4.0 already installed. Requirements met for constraints: >=2.4.0
2024-10-07 00:23:17,602 - INFO - uno_component: LibrePythonista execution time: 0.022 seconds
2024-10-07 00:23:27,611 - INFO - uno_component: LibrePythonista version 0.3.2 execute starting
2024-10-07 00:23:27,613 - INFO - libre_pythonista.install.requirements_check: Package typing-extensions 4.12.2 already installed. Requirements met for constraints: >=4.12.2
2024-10-07 00:23:27,615 - INFO - libre_pythonista.install.requirements_check: Package verr 1.1.2 already installed. Requirements met for constraints: >=1.1.2
2024-10-07 00:23:27,618 - INFO - libre_pythonista.install.requirements_check: Package pandas 2.0.3 already installed. Requirements met for constraints: >=2
2024-10-07 00:23:27,620 - INFO - libre_pythonista.install.requirements_check: Package odfpy 1.4.1 already installed. Requirements met for constraints: >=1.4
2024-10-07 00:23:27,622 - INFO - libre_pythonista.install.requirements_check: Package ooo-dev-tools 0.47.17 already installed. Requirements met for constraints: >=0.47.17
2024-10-07 00:23:27,624 - INFO - libre_pythonista.install.requirements_check: Package matplotlib 3.7.5 already installed. Requirements met for constraints: >=3.7.5
2024-10-07 00:23:27,626 - INFO - libre_pythonista.install.requirements_check: Package seaborn 0.13.2 already installed. Requirements met for constraints: >=0.13
2024-10-07 00:23:27,627 - INFO - libre_pythonista.install.requirements_check: Package sortedcontainers 2.4.0 already installed. Requirements met for constraints: >=2.4.0
2024-10-07 00:23:27,627 - INFO - uno_component: LibrePythonista execution time: 0.017 seconds
2024-10-07 00:26:24,664 - INFO - uno_component: LibrePythonista version 0.3.2 execute starting
2024-10-07 00:26:24,667 - INFO - libre_pythonista.install.requirements_check: Package typing-extensions 4.12.2 already installed. Requirements met for constraints: >=4.12.2
2024-10-07 00:26:24,669 - INFO - libre_pythonista.install.requirements_check: Package verr 1.1.2 already installed. Requirements met for constraints: >=1.1.2
2024-10-07 00:26:24,671 - INFO - libre_pythonista.install.requirements_check: Package pandas 2.0.3 already installed. Requirements met for constraints: >=2
2024-10-07 00:26:24,673 - INFO - libre_pythonista.install.requirements_check: Package odfpy 1.4.1 already installed. Requirements met for constraints: >=1.4
2024-10-07 00:26:24,675 - INFO - libre_pythonista.install.requirements_check: Package ooo-dev-tools 0.47.17 already installed. Requirements met for constraints: >=0.47.17
2024-10-07 00:26:24,676 - INFO - libre_pythonista.install.requirements_check: Package matplotlib 3.7.5 already installed. Requirements met for constraints: >=3.7.5
2024-10-07 00:26:24,678 - INFO - libre_pythonista.install.requirements_check: Package seaborn 0.13.2 already installed. Requirements met for constraints: >=0.13
2024-10-07 00:26:24,680 - INFO - libre_pythonista.install.requirements_check: Package sortedcontainers 2.4.0 already installed. Requirements met for constraints: >=2.4.0
2024-10-07 00:26:24,680 - INFO - uno_component: LibrePythonista execution time: 0.016 seconds
2024-10-07 00:26:48,890 - ERROR - PyModule: Error initializing module
Traceback (most recent call last):
  File "/home/andreas/.config/libreoffice/4/user/uno_packages/cache/uno_packages/lu1362151ju8b0.tmp_/LibrePythonista.oxt/pythonpath/libre_pythonista_lib/code/py_module.py", line 71, in _init_mod
    exec(code, self.mod.__dict__)
  File "<string>", line 3, in <module>
  File "/opt/libreoffice24.2/program/uno.py", line 346, in _uno_import
    return _builtin_import(name, *optargs, **kwargs)
  File "/home/andreas/.local/lib/python3.8/site-packages/matplotlib/__init__.py", line 124, in <module>
    import numpy
  File "/opt/libreoffice24.2/program/uno.py", line 346, in _uno_import
    return _builtin_import(name, *optargs, **kwargs)
  File "/home/andreas/.local/lib/python3.8/site-packages/numpy/__init__.py", line 141, in <module>
    from . import core
  File "/opt/libreoffice24.2/program/uno.py", line 425, in _uno_import
    raise uno_import_exc
  File "/opt/libreoffice24.2/program/uno.py", line 346, in _uno_import
    return _builtin_import(name, *optargs, **kwargs)
  File "/home/andreas/.local/lib/python3.8/site-packages/numpy/core/__init__.py", line 49, in <module>
    raise ImportError(msg)
ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.8 from "/usr/bin/python3"
  * The NumPy version is: "1.24.4"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: No module named 'numpy.core._multiarray_umath' (or 'numpy.core._multiarray_umath.add_docstring' is unknown)
 (or '.core' is unknown)

and my Python environment

1 Like

:rofl: :joy: That pic sums it up.

I see by the log that all the python packages are installed when LibreOffice and LibrePyhtonista was started.
If the python packages were installed via some other method and they have the cpython.so issue, such as Numpy, Pandas, Matlab 

In this LibrePyhtonista’s installer will not check for Linking for existing packages. I think I will build in a a menu option to re-run linking.


So, I possible try the following steps in the mean time.

  1. In Calc go to the extension manager.
  2. Select LibrePythonista.
  3. Click the options and set the log to debug. (do not uninstall LibrePythonista)
  4. Close Calc and LibreOffice
  5. Go to your site-packages dir and delete or rename site-packages.
  6. Go to the LibrePythonista log file and delete the log or clear out is contents.
  7. Open Calc and re-install LibrePythonista over the existing installed version (this will be the same version)
    After Install is complete LibreOffice Calc will need to be restarted.
  8. If still not working repost the log.

Version 0.4.0 of LibrePythonista is now available. It includes a LibrePy -> Pip -> Linking -> Link Binary Files and LibrePy -> Pip -> Linking -> Unlink Binary Files Menu options.


This will allow for creating the needed System Links to python packages that have been installed outside of LibrePythonista. These options only apply to LibreOffice version that use embed python on MacOs and Linux. Windows does not have this issue even though it used an embedded python.

!SORRY I NEED TO WARN EVERYBODY TO INSTALL LIBREPYTHONISTA!

@vib: after open »any.ods« 
 your extension changes the »doc_has_changed_status« and embeds some folders into the zip-archiv 
 REGARDLESS if your use librepythonista on this doc or not or your change the doc otherwise
 see:

I’ll hope for you, you will claim it as a serious bug 
 and NOT BY PURPOSE!

Well I am befuddled. What is the issue with storing data in the file. Where else would it go. Many extensions change files !?!?

I would never expect any extension to store its data in a file that doesn’t use that extension; I agree that it’s a problem if it doesn’t consider that piece.

1 Like

THE ISSUE IS: YOUR EXTENSION DOES IT WITHOUT WARRANTY AND WITHOUT ANY USERINTERACTION 
 THATS RIDICOULUS AND RUDE!

This I can aggree with. It is not intentional that LibrePythonista slightly modifies existing Calc Files when they are saved when the extension is present.


This is a known issue. Remember LibrePythonista is still in Beta.
It is expected to be corrected soon but as far as issues go I don’t see how this has any negative impact, but again this is a known issue and not a permament issue.

and where give you any hint about that »known issue«

There is not a lot of documentaion for LibrePythonista just yet.
However on the intro video there is a comment “hello again, i notice a small problem. When you open Calc with the initial default spreadsheet, Calc ask immediately to save the spreadsheet 
while nothing has been done. Again very nice work !”


It is noted there in the reply that this a known issue to get worked out.

So I have to read the reply to some youtube to get informed about that ???

You have to live with whatever workflow the volunteer extension developer chooses for them to create their nice work, or wait until they change it when (if) that will be reasonable / considered necessary - or avoid that extension. In this case:

  1. @vib didn’t realize that the whole issue was the “storing unconditionally”, when replying to your message as if it was OK;
  2. You hyper-react, expecting a perfect solution and an enterprize-grade support with established ticket system and notifications and and and 
 from this just-started project.

Admittedly that is not ideal. It just never occurred to me that I should put it the Extension description. So thanks for bringing it to my attention and I have added a Known Issues section in the Extensions Description.

1 Like

@mikekaganski Is this a reply to me?
@vib has a github-repository with included »issue«tab there is no note about »this known issue«

1 Like

:innocent:

1 Like