Building ParaView with external Python modules in a portable way

I would like to build ParaView with support for the Python modules xarray and scipy, and I was originally planning to use Docker to package the build in a portable way. The workflow is all local; I download the data I want to visualize on my machine and use ParaView locally. I am working on Windows (and WSL for some processing of the data before visualizing), but I would actually like to move my workflow with ParaView entirely to Linux, so I wanted to make a Linux container that could be used to replicate my workflow on any machine.

However, from reading the posts here and here it seems it’s not possible to run ParaView in a Docker container on my local machine, although I’m not sure if I’m understanding these posts correctly, since I am fairly new to Docker. Are there any recommendations for building ParaView with external Python modules in a portable way?

When using Python thirdparty I use virtual-env (not venv) with ParaView. You can see how to do it here which is used in our Web project here as an example.

Thank you @jourdain ! After doing some more searching I realized that the Linux version of ParaView already has scipy included, so I might not need to do a new build after all if I can use that version (I think I can get by with just scipy and no xarray).

I have a follow-up question on the Docker side of things. I just found out about the Headless ParaView binaries for Linux. Since I don’t 100% need the GUI, I’m fine with just using pvpython to create my visualizations. I tested this on my WSL Ubuntu shell by using the ParaView-5.9.1-osmesa-MPI-Linux-Python3.8-64bit version. Would this way of using ParaView work from an Ubuntu Docker container running on my local machine, or am I missing something?

That docker image should work just fine. You could even produce rendered images if you want. They will be slower to render but that will still work.

Sorry I should clarify, I didn’t test one of the ParaView Docker images, I just downloaded the Headless binaries for Linux and ran pvpython on WSL. So I was thinking I could do the same thing to build a Docker container, which will also include some other software I need to process the data before making visualizations.

I’m not sure what you mean by producing rendered images if I want.

Sure that will work. I just meant you can still trigger some Render() call if need be with osmesa.

Ah I see, that makes sense.

Thanks for your help!