Linux - Install Pip Package via Zaz-Pip

Overview

Although pip can be installed into Linux LibreOffice manually, see Linux - Install pip packages into LibreOffice. It is possible to pip install in LibreOffice using an extension. See Install Zaz-Pip LibreOffice Extension.

The steps below are the same for LibreOffice Snap. See also Windows - Install pip into LibreOffice Portable.

Note

This guide assumes you have already installed LibreOffice.

Anywhere you see guide it needs to be replaced with your username.

Installing Pip

Pip should already be installed in your Linux distribution. If it is not, then see Test Pip of the Linux - Install pip packages into LibreOffice guide.

Add a Pip package

Admin PIP

Fig. 1208 Admin PIP

We will install ooo-dev-tools package as an example.

Click the Admin PIP button. Type in ooo-dev-tools.

Note

If you have a dark theme like this example, then you may not see the characters when you type them in ( white text on light yellow background). If this is the case, no worries, you can just select the text to see what it typed.

Enter package Name

Enter Package Name

Fig. 1209 Enter Package Name

Click Yes to the popup see in Fig. 1210.

Enter Package Name

Fig. 1210 Enter Package Name

Installing in this case did take a bit of time. Be patient and wait to see Successfully installed ... as seen in Fig. 1211.

Enter Package Name

Fig. 1211 Enter Package Name

Zaz_Pip installs it packages into user directory something like /home/guide/.local/lib/python3.10/site-packages where guide is the username.

Testing installed Pip package

ooo-dev-tools has been installed and now we can use it to do a quick test.

Open LibreOffice Writer. Open the APSO console. See also Install APSO LibreOffice Extension.

Add each line to the APSO console, one line at a time followed by the Enter key.

APSO python console [LibreOffice]
3.10.11 (main, Nov 10 2011, 15:00:00) [GCC 12.2.0]
Type "help", "copyright", "credits" or "license" for more information.
>>> from ooodev.write import WriteDoc
>>> def say_hello():
...     doc = WriteDoc.from_current_doc()
...     cursor = doc.get_cursor()
...     cursor.append_para(text="Hello World!")
...
>>> say_hello()
>>>

After the line Write.append_para(cursor=cursor, text="Hello World!") is added and the Enter key has been pressed, Hello World! will show up in the Writer document as seen in Fig. 1212. Now we have working pip packages and can add any pip package we need using Zaz-Pip extension.

Hello World!

Fig. 1212 Hello World!