How to use pyvista in Docker for Windows 10 user


I install FEniCSx in Windows 10.
Following the guide obtaining-the-software, I install FEniCSx in docker by

docker run -ti -v D:/work-fenicsx:/root/shared --name fenicsx-container dolfinx/dolfinx

Then I download,
and run


in container.
The system tells

pyvista is required to visualise the solution

I’m not familier to Docker.
I want to know how to install pyvista in Docker container?

Pyvista can be installed in a docker container with the following commands:

apt-get update
apt-get install -y --no-install-recommends libgl1-mesa-dev xvfb
pip3 install pyvista

Running the demo after this command will save the plot to “u.png”: dolfinx/ at main · FEniCS/dolfinx · GitHub
If you want interactive visualization when using Windows, i suggest you use Paraview to open the resulting XDMFFile: dolfinx/ at main · FEniCS/dolfinx · GitHub

1 Like