Cadquery installation on server


We would like to include cadquery 2.4 in our project in order to generate glTF files and render them in a geometry view.

It works perfectly while running the app locally but, when trying to publish the app, I get the error: No matching distribution found for cadquery-ocp<7.8,>=7.7.0a0.

I tried including the wheel files of cadquery-ocp (linux, then windows) to the project in order to perform a local installation but got an error saying that they did not match the server system.

I’m running out of ideas to work around this issue. Do you have any suggestions ?

We are using python 3.12, but our issue isn’t related to this one since we found a workaround for it.

I think a simple way to reproduce the issue would be to create a new app and simply add cadquery into requirements.txt. viktor-cli install and viktor-cli start should work, but not viktor-cli publish.

1 Like

I get an other error when trying to publish with python 3.11:

ImportError: cannot open shared object file: No such file or directory

2024-04-15 14:48:07.803 ERROR   : cannot open shared object file: No such file or directory
error building image: error building stage: failed to execute command: waiting for process to exit: exit status 1

But it works when installing and and starting locally.

Hi Pierre,

It appears cadquery requires an additional dependency when running on Linux (libGL). You can make sure that these system dependencies are installed during publication of your app by including the dependency in your viktor.config.toml file. If you add the following line libGL will be installed while publishing your app:

packages = ["libgl1"]

More information on system dependencies can be found here: Development tools & tips - Use system dependencies | VIKTOR Documentation

Let me know if this solves your problem,



Hi Raoul,

Thanks for the reply.
It solves the problem when using python 3.11 but we still get the same error with python 3.12. Did you have a chance to look into it ? This is the version we use in our project and we would really appreciate not having to downgrade it.

Thank you,


Hi Pierre,

I cannot reproduce the error you reported while publishing with Python 3.12 and the requirements as follows:


After I imported cadquery in my main file, I get an error that the module OCP is missing. Subquently, after adding cadquery-ocp to my requirements file I get the same error.

The reason for this error is that the VIKTOR apps are deployed using base images with Debian 11 (“bullseye”) as OS. The wheels uploaded to PyPi require a newer version of glibc>=2.35, however, Debian 11 comes with an older version of glibc (2.31). Hence, the resulting error message.

The cadquery-ocp wheels are not available for the combination glibc 2.31 and python 3.12 on PyPi, so the solution for now is to use Python 3.11.

Hi Raoul,

So you were able to reproduce the error in the end.
Thanks for the very clear explanation.
I have to ask: Any idea when you’ll be using Bookworm ?

Hi Pierre,

We haven’t planned this as of yet. If/when I know more I’ll update here.