Issues with running pvpython

Ubuntu Version - 18.04
Python Version - 2.7.17
Python3 Version - 3.6.9
VTK version -

I’m trying to use pvpython to run a python script to write out .pvd and .vtu files, however pvpython opens with the 2.7.17 version and this causes the “import vtk” in my script to segmentation fault (core dumped). I have the following strategies to mitigate my problem, but however would need some support to do them:

  1. Import vtk using “from paraview import vtk” command, However this leads to less classes inside vtk module of paraview. So I could update the vtk module inside the paraview directory to include the classes that I need (vtkXMLUnstructuredGridWriter etc.)
  2. Install a higher version of Paraview like 5.8 so that it natively uses python3 as the interpretor for pvpython.
  3. Change the native python interpreter of pvpython as python3.

Kindly guide
Regards
Kaushik

Have you tried to download and unpack ParaView-5.9.1-MPI-Linux-Python3.8-64bit.tar.gz from https://www.paraview.org/download/ and then use that version?

Yes, but when I call pvpython it doesnt execute.

You’ll have to run it like

/wherever/you/installed/it/ParaView-5.9.1-MPI-Linux-Python3.8-64bit/bin/pvpython

or add /wherever/you/installed/it/ParaView-5.9.1-MPI-Linux-Python3.8-64bit/bin to your search path.

Sorry but could you elaborate on “search path”. I’m kind of new to Linux environment.
Thanks again.