Skip to main content

Use system dependencies

BETA FEATURE

Using system dependencies is a beta feature and may not be entirely stable yet. Please reach out to VIKTOR in case you run into any issues.

In some cases your application uses Python packages that depend on one or multiple packages that cannot be installed using pip. These system packages need to be installed with the package manager of the operating system. For example vtk could be used for processing of images. When you try to publish an app, you may receive the following error:

ImportError: libGL.so.1: cannot open shared object file: No such file or directory

Above error happens because vtk is using an OpenGL-based program in the background which requires libGL. To annotate that such system dependencies should be installed when the application is being published, you can specify packages in your app's viktor.config.toml file:

packages = ["libgl1"]

The provided packages should be apt-get compatible as published VIKTOR apps run on Linux.

Common system packages

The table below provides common use cases for Python package with their required system packages.

Python packageSystem package(s)Use case
ffmpeg-pythonffmpegVideo file processing
opencv-pythonpython3-opencvImage processing
pdf2docxlibgl1PDF file processing
pyenchantpython3-enchantSpelling check and correction suggestions
pyomo (GLPK solver)libglpk-dev, glpk-utilsFormulating, solving, and analyzing optimization models
pytesseracttesseract-ocrImage processing
python-popplerpoppler-utils, libpoppler-cpp-devPDF file processing
pyvistalibgl1High-level API for Visualization Toolkit (VTK)
vtklibgl1Image processing
Help us improve

Do you have a use case which is not listed in the table above? Please contact support@viktor.ai or post a message on the Community Forum and help us improve this overview!