1

I have to run some paraview trace file in python to automate the process. For this, I have I am trying to import paraview as

from paraview.simple import *

But, it is showing me an error as

"Failed to load vtkClientServerPython: No module named vtkmodules.vtkCommonCorePython"
I have run paraview from python before and it was working fine. But now, this is giving me a problem from few days. How to overcome this? Below is the complete sys path for paraview which is included in code.
import numpy as np
import sys, os
ParaViewBuildPath = "/home/ParaView-5.7.0-MPI-Linux-Python3.7-64bit/"
sys.path.append(ParaViewBuildPath + "lib/") 
sys.path.append(ParaViewBuildPath + "lib/python3.7/site-packages")
sys.path.append(ParaViewBuildPath + "lib/python3.7/site-packages/vtkmodules")

from paraview.simple import *
rasunag27
  • 55
  • 4
  • 11
  • Which interpreter do you use ? Do you have another paraview in your path ? – Nico Vuaille Mar 23 '21 at 09:13
  • @NicoVuaille I am using Spyder IDE. I do not have any other paraview in the path. Even if I change the path to paraview 5.8, I get the same error. Before it was not there. From few days, this is happening. Hope I understood your question and answered correctly. – rasunag27 Mar 23 '21 at 09:27
  • Did you try with the `pvpython` executable as interpreter ? – Nico Vuaille Mar 23 '21 at 10:25
  • @NicoVuaille Yes..pvpython works in terminal. But how do I get pvpython in IDE? I need in IDE because I want it to be automated before and after this part of code too..!! – rasunag27 Mar 23 '21 at 16:57
  • What is the python version used by Spyder ? Something else you can try is to set environment variable `PYTHONPATH` outside of python script, instead of settings sys.path – Nico Vuaille Mar 24 '21 at 09:10
  • I am using python 3.6 version in conda environment..!! Can you shed a light on how to use PYTHONPATH Variable? Thanks..!! – rasunag27 Mar 24 '21 at 16:24
  • so you are trying to use python 3.7 modules from a python 3.6 interpreter ... That is obviously error prone. Setting environmnent var should probably done in Spyder, but I do not know anything about this software. – Nico Vuaille Mar 24 '21 at 16:26

0 Answers0