Install Third-party libraries

Hello :grinning:
With the docker compose, is there any doc talking about installing “Third-party libraries”
how can we install libraries like jinja for example ?

Hi @Sao,

If you are comfortable with docker, you can make a version of Grist with extra python libraries as follows. Make an empty directory, and in it create a file called Dockerfile containing the following:

FROM gristlabs/grist

  apt update && apt install -y openssl && \
  python3 -m pip install Jinja2

Then build a docker image from this using the docker command:

docker build -t paulfitz/grist .

(I’m calling the image paulfitz/grist but you could call it what you like). If all goes well, you should see a lot of lines about installation, including:

Successfully installed Jinja2-3.1.2 MarkupSafe-2.1.1

Now you can do a quick test of the result by starting a container from your new image:

docker run -p 8484:8484 -it paulfitz/grist

You should see a Welcome to Grist message and other lines about how Grist is set up. Now if you go to your browser and visit:


You should see an empty Grist installation. Click Create Empty Document and stick this formula in a cell:

import jinja2

All going well the cell should show something like 3.1.2 (that’s what it did for me), showing that Jinja is now available.

If you are using docker compose, then all you need to do now is get your image to wherever you are running Grist, and swap it in for gristlabs/grist. Let me know if you need help with that step.

Good luck! :smiley:

1 Like