LibreOffice comes with a bundled Python that has a limited set of packages and it is not possible to install additional packages as numpy, pandas or other popular packages (see 143980 and 143867). One not-so-complicated way to solve this issue would be to create a new dialog in "Tools - Options" so the user can choose which Python interpreter to use. This way the user can install another Python interpreter and add whatever packages he/she needs. The idea would be to create a new dialog similar to the one we currently have for JRE in Tools - Options - Advanced. The user could then select the base path for the python interpreter that will be used by LO. By default it can be the one bundled in LO's installation, but advanced users will be able to choose a different one and set it up as they wish. This idea was inspired by the fact that on Ubuntu, if you install LibreOffice from their PPA it will not come with the bundled Python shipped with LO. Instead it will use system-wide Python and any packages installed will work in Python scripts launched from within LO (see 143980 comment #7).
Thanks Rafael. I think it's a brilliant idea and it can help many people to use python scripts instead our old StarBasic
Thanks Rafael. Also I think it's a brilliant idea to choose the python interpreter that will be used by LO. More simpler will be the use of Python, LO will be very faster e powerful. A normal user of my App isn't able to use PIP, while install Python is more simpler, like install LO.
Not much to add from UX POV. New "Python options" goes to LibreOffice > Advanced with a list similar to "Java Options" but without the use it checkbox and the interaction buttons. The list should offer all Python interpreters (location might be shown per tooltip).
(In reply to Rafael Lima from comment #0) > LibreOffice comes with a bundled Python that has a limited set of packages > and it is not possible to install additional packages as numpy, pandas or > other popular packages (see 143980 and 143867). *WRONG* - see https://ask.libreoffice.org/t/install-python-package-for-libre-office/66934/15 - Installs scipy and numpy. The big issue is Python needs pip to install packages but it is not implemented in LO and the community is fairly clueless how to install it - see Bug #143867 Clearly the community has little idea how to do it - https://ask.libreoffice.org/t/install-python-package-for-libre-office/66934 Even there the dll is missing. Someone muddling through the process and installing pip and packages doesn't mean everything is fine. A better solution is better support of the existing embedded Python, including pip. > One not-so-complicated way to solve this issue would be to create a new > dialog in "Tools - Options" so the user can choose which Python interpreter > to use. This way the user can install another Python interpreter and add > whatever packages he/she needs. Each version of LO has a known embedded version of Python, a big advantage. That's not the case with a user's system python. I wouldn't support this configuration to replace the standard install. Installing embedded LO python in a Virtual Environment is well worth considering.
this cannot possibly work, the python shared libraries do not have a stable ABI and the pyuno library depends on that in contrast, the JVM does have a stable ABI, so you can select any one that's at least the minimal version
(In reply to Rafael Lima from comment #0) > This idea was inspired by the fact that on Ubuntu, if you install > LibreOffice from their PPA it will not come with the bundled Python shipped > with LO. Instead it will use system-wide Python and any packages installed > will work in Python scripts launched from within LO (see 143980 comment #7). (In reply to Michael Stahl (allotropia) from comment #5) > this cannot possibly work, the python shared libraries do not have a stable > ABI and the pyuno library depends on that Also note that the python executable in the LibreOffice program directory is actually a wrapper (a shell script on Linux and macOS, see pyuno/CustomTarget_python_shell.mk; an .exe on Windows, see pyuno/Executable_python.mk) that is careful to set up an environment in which LibreOffice's PyUNO also works for stand-alone Python programs. Linux distributions that do not include that wrapper but use the distro's python executable directly typically make sure to set up that environment, too, in a different way.