Python macros which used to run on previous versions of librecalc could not be invoked after update to 24.8.4. See the attached screenshot. Masking out this version and downgrading to 24.2.7.2, the macros started working as before. Reproducible: Always
Created attachment 919125 [details] Error window
Can you give me steps to reproduce, assuming I've never used macros before, with some simple example? Thanks.
Created attachment 919127 [details] hello_macro.py
Hi Sam, Attached simple python macro example Installation Instructions: 1. Copy the Script $ cp hello_macro.py /usr/lib64/libreoffice/share/Scripts/python/ 2. Enable Macros - Open LibreOffice Calc. - Go to Tools -> Options -> LibreOffice -> Security -> Macro Security. - Set security to High to allow Python macros. 3. Run the Macro - Open Calc. - Select any cell. - Go to Tools -> Macros -> Run Macro. - Navigate to Application Macros -> hello_macro.py -> hello_macro. - Click Run. 4. Check Output - The selected cell should now contain "Hello world, LibreOffice year 2025".
I found that libreoffice 24.8 installation path is different from the 24.2 version and also there is a new use flag to enable 'python'. After moving the scripts to the new path and enabling the use flag, the scripts worked. The new path is "/opt/libreoffice24.8/share/Scripts/python/"
If I can report different issue in version 24.8, the headless command line gives errors which were not in 24.2: $ /opt/libreoffice24.8/program/soffice --convert-to csv:"Text - txt - csv (StarCalc):44,,,,,,,,,,,6" --headless file.ods Could not find platform independent libraries <prefix> Could not find platform dependent libraries <exec_prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] convert file.ods as a Calc document using filter : Text - txt - csv (StarCalc):44,,,,,,,,,,,6 Writing sheet Test -> balance-Test.csv
(In reply to email200202 from comment #5) > I found that libreoffice 24.8 installation path is different from the 24.2 > version and also there is a new use flag to enable 'python'. > > After moving the scripts to the new path and enabling the use flag, the > scripts worked. > > The new path is "/opt/libreoffice24.8/share/Scripts/python/" It's a bit of a shame but the new versioning scheme (which is in a sense great as it allows slotting) falls prey to this. Maybe can add an einfo about it though on upgrades?
Many thanks for the simple testcase. Let me try reproduce the 2nd error.