Linker error when using pvpython

I am trying to use the headless build of paraview 5.9.1 (EGL and Mesa) that I downloaded from the Paraview website (ParaView-5.9.0-egl-MPI-Linux-Python3.8-64bit.tar.gz). I have not found a guide for running this, so I tried just launching pvpython from the bin folder after uncompressed.

When I try to import anything from the paraview module, it fails and it is ultimately because it is trying to load vtk libraries like:
whereas the vtk module libraries in the lib folder are in the format:

I have an install of VTK elsewhere that I have compiled and I tried using LD_LIBRARY_PATH to use those libs, but that just caused a bunch of segfaults when I import paraview. My assumption is that pvpython should be loading the dynamic libraries in that lib folder but for some reason it is looking for the wrong library conventions. I have tried completely unsetting my environment before running pvpython, but this did not help. I also tried 5.9.0 in case there was a bug in that build.

I am on Ubuntu 20.04.2.

[glow@arch ~/work/paraview/others]$ cd ParaView-5.9.1-osmesa-MPI-Linux-Python3.8-64bit/
[glow@arch ~/work/paraview/others/ParaView-5.9.1-osmesa-MPI-Linux-Python3.8-64bit]$ ./bin/pvpython
Python 3.8.8 (default, May 17 2021, 15:56:25) 
[GCC 7.3.1 20180303 (Red Hat 7.3.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from paraview.simple import *
>>> exit()

works perfectly here. Make sure your archive is complete.

Interesting - it seems to be because I had a VTK whl installed. I just noticed:

import vtkmodules.vtkCommonCore
Traceback (most recent call last):
File “/home/mbm/.local/lib/python3.8/site-packages/vtkmodules/”, line 13, in
from . import vtkCommonCore
ImportError: cannot open shared object file: No such file or directory

As soon as I executed a pip3 uninstall vtk, then it imported paraview just fine.

@ben.boeckel : Looks like an issue ? ParaView should uses its own libs if available, should it not ?

This is not supported. ParaView uses its own build of VTK and using/replacing it with an external build is not supported at all. VTK names the libraries with its version numbers, ParaView uses its version number (with the pv prefix).

This was a wrong idea from OP. In any case paraview should not try to pick up local system libs.

ParaView isn’t doing anything like that. My guess is that PYTHONPATH (or some other Python packaging setup) is causing that VTK’s Python modules to be picked up first.

Right, you may want to check your environnement variables @mbm

To be clear, the library path was something I initially tried. The behavior was the same with a completely empty environment. For some reason when my vtk whl was installed, the paraview install tries to load the wrong libraries. I’ll see if I can reproduce in a new container.