# Building ParaView with external Python modules in a portable way

**URL:** https://discourse.paraview.org/t/building-paraview-with-external-python-modules-in-a-portable-way/7802
**Category:** ParaView Support
**Tags:** python
**Created:** [August 11, 2021, 7:06pm UTC](https://discourse.paraview.org/t/building-paraview-with-external-python-modules-in-a-portable-way/7802 "2021-08-11T19:06:45Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![mbotto](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/90ced4/32.png) [@mbotto](https://discourse.paraview.org/u/mbotto)
#### Post date: [August 11, 2021, 7:06pm UTC](https://discourse.paraview.org/t/building-paraview-with-external-python-modules-in-a-portable-way/7802/1 "2021-08-11T19:06:45Z")

</div>

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](https://discourse.paraview.org/t/installing-paraview-on-ubuntu/6201/10) and [here](https://discourse.paraview.org/t/build-redistributable-paraview-sdk-using-paraviewpluginbuilder/3676/2) 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?

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [August 11, 2021, 7:27pm UTC](https://discourse.paraview.org/t/building-paraview-with-external-python-modules-in-a-portable-way/7802/2 "2021-08-11T19:27:12Z")

</div>

When using Python thirdparty I use `virtual-env` (not venv) with ParaView. You can see how to do it [here](https://blog.kitware.com/using-pvpython-and-virtualenv/) which is used in our Web project [here](https://github.com/Kitware/visualizer/blob/master/server/pvw-visualizer.py#L86-L92) as an example.

---

<div class="post-metadata">

### Author: ![mbotto](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/90ced4/32.png) [@mbotto](https://discourse.paraview.org/u/mbotto)
#### Post date: [August 11, 2021, 10:24pm UTC](https://discourse.paraview.org/t/building-paraview-with-external-python-modules-in-a-portable-way/7802/3 "2021-08-11T22:24:12Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [August 11, 2021, 10:52pm UTC](https://discourse.paraview.org/t/building-paraview-with-external-python-modules-in-a-portable-way/7802/4 "2021-08-11T22:52:33Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![mbotto](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/90ced4/32.png) [@mbotto](https://discourse.paraview.org/u/mbotto)
#### Post date: [August 11, 2021, 11:05pm UTC](https://discourse.paraview.org/t/building-paraview-with-external-python-modules-in-a-portable-way/7802/5 "2021-08-11T23:05:59Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [August 12, 2021, 3:54am UTC](https://discourse.paraview.org/t/building-paraview-with-external-python-modules-in-a-portable-way/7802/6 "2021-08-12T03:54:40Z")

</div>

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

---

<div class="post-metadata">

### Author: ![mbotto](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/90ced4/32.png) [@mbotto](https://discourse.paraview.org/u/mbotto)
#### Post date: [August 12, 2021, 8:19pm UTC](https://discourse.paraview.org/t/building-paraview-with-external-python-modules-in-a-portable-way/7802/7 "2021-08-12T20:19:10Z")

</div>

Ah I see, that makes sense.

Thanks for your help!
