Compatibility Issue Between ParaView and PyVista in Python

I am encountering a compatibility issue when attempting to use both ParaView and PyVista within the same Python virtual environment. The problem seems to stem from conflicts in the VTK versions required by these two libraries. When I install both libraries, I encounter the following error upon importing ParaView:

>>> import paraview
Traceback (most recent call last):
  File "/opt/miniconda/envs/para/lib/python3.13/site-packages/paraview/__init__.py", line 217, in <module>
    from .modules import vtkRemotingCore
ImportError: Failed to load vtkRemotingCore: No module named paraview.modules.vtkRemotingClientServerStream

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    import paraview
  File "/opt/miniconda/envs/para/lib/python3.13/site-packages/paraview/__init__.py", line 219, in <module>
    import _paraview_modules_static
ModuleNotFoundError: No module named '_paraview_modules_static'

System Details:

  • Base Docker Image: nvidia/cuda:12.6.2-cudnn-runtime-ubuntu22.04
  • Python Version: >=3.9 (tried multiple versions, including 3.13.1)
  • ParaView Versions Tried: 5.8.0 to 5.13.1 (via Conda)
  • PyVista Versions Tried: 0.20.1 to 0.44.2 (via Conda)
  • Environment Manager: Conda (with virtual environment)

If I understand well the conflict arises because ParaView ships with its own bundled VTK installation, while PyVista requires a separate VTK version. Installing PyVista results in overwriting the ParaView-specific VTK, which subsequently breaks the ParaView installation and leads to the aforementioned import error.

Questions:

  1. Is there a known workaround to use both ParaView and PyVista in the same Python virtual environment?
  2. Would it be possible to configure ParaView to use the VTK installed by PyVista, or vice versa, without breaking functionality?

If anyone has encountered similar issues or has insights on how to work around this limitation, your guidance would be greatly appreciated!

Thank you for your help!

The setup that I tend to use (which may not match what you want to do) is to use the downloaded version of ParaView 5.13 with a venv on the side. Then in that venv, I pip install PyVista and uninstall vtk.

I’m running some Python scripts for medical image analysis, performing post-processing with libraries such as Pyvista, and then using ParaView to automatically generate ParaView states for clinicians to directly analyze. Ideally, I would prefer to have PyVista and ParaView within the same virtual environment, so the downloaded GUI version is not what I’m looking for. However, if that’s not feasible, I’ll have to create two separate virtual environments.

We are not managing the conda packages so we can’t really fix the VTK compatibility issue described.

We’ll eventually have a pip installable ParaView but we are not there yet.

You might still be able to incrementally build your conda env by installing pyvista, uninstalling vtk, installing paraview.