error occurs when read VTK file through pvpython

Hi all,
I am pretty new to Paraview and pvpython. I used to use paraview client GUI to load data and generate image and animation. But I would like to learn to use pvpython instead. Firstly, I used “Trace” feature in paraview client GUI to record my action with Python script. However, when I tried to run the save script from “Trace” in pvpython, I got an error message when reading VTK files. I didn’t run into any problems when I read the data with paraview client GUI. The error message is as below. I wonder what does the error mean and how should I solve this. Any thoughts would be greatly appreciated. Thank you!

 # trace generated using paraview version 5.10.1
 #import paraview
 #paraview.compatibility.major = 5
 #paraview.compatibility.minor = 10

 #### import the simple module from the paraview
 from paraview.simple import *
 #### disable automatic camera reset on 'Show'

 # create a new 'Legacy VTK Reader'
 ssm_ts_uv_001 = LegacyVTKReader(registrationName='ssm_ts_uv_001*', FileNames="""'

output\\ssm_ts_uv_00134.vtk', '
output\\ssm_ts_uv_00135.vtk', '
output\\ssm_ts_uv_00136.vtk', '
output\\ssm_ts_uv_00137.vtk', '
output\\ssm_ts_uv_00138.vtk', '
output\\ssm_ts_uv_00139.vtk', '
output\\ssm_ts_uv_00140.vtk', '
output\\ssm_ts_uv_00141.vtk', '
output\\ssm_ts_uv_00142.vtk', '
output\\ssm_ts_uv_00143.vtk', '
output\\ssm_ts_uv_00144.vtk', '
output\\ssm_ts_uv_00145.vtk', '
output\\ssm_ts_uv_00146.vtk', '
output\\ssm_ts_uv_00147.vtk', '
output\\ssm_ts_uv_00148.vtk', '
output\\ssm_ts_uv_00149.vtk', '
output\\ssm_ts_uv_00150.vtk', '
output\\ssm_ts_uv_00151.vtk', '
output\\ssm_ts_uv_00152.vtk', '
output\\ssm_ts_uv_00153.vtk', '
output\\ssm_ts_uv_00154.vtk', '
output\\ssm_ts_uv_00155.vtk', '
output\\ssm_ts_uv_00156.vtk', '
output\\ssm_ts_uv_00157.vtk', '
output\\ssm_ts_uv_00158.vtk', '
output\\ssm_ts_uv_00159.vtk', '
output\\ssm_ts_uv_00160.vtk', '
output\\ssm_ts_uv_00161.vtk', '
output\\ssm_ts_uv_00162.vtk', '
output\\ssm_ts_uv_00163.vtk', '
output\\ssm_ts_uv_00164.vtk', '
output\\ssm_ts_uv_00165.vtk', '
output\\ssm_ts_uv_00166.vtk', '
output\\ssm_ts_uv_00167.vtk', '
output\\ssm_ts_uv_00168.vtk', '
output\\ssm_ts_uv_00169.vtk', '
(  60.189s) [paraview        ]  vtkPDataSetReader.cxx:668    ERR| vtkPDataSetReader (000001EBBCF85CD0): Initialize: Could not open file 'output\ssm_ts_uv_00134.vtk', 'output\ssm_ts_uv_00135.vtk', 'output\ssm_ts_uv_00136.vtk', 'output\ssm_ts_uv_00137.vtk', 'output\ssm_ts_uv_00138.vtk', 'output\ssm_ts_uv_00139.vtk', 'output\ssm_ts_uv_00140.vtk', 'output\ssm_ts_uv_00141.vtk', 'output\ssm_ts_uv_00142.vtk', 'output\ssm_ts_uv_00143.vtk', 'output\ssm_ts_uv_00144.vtk', 'output\ssm_ts_uv_00145.vtk', 'output\ssm_ts_uv_00146.vtk', 'output\ssm_ts_uv_00147.vtk', 'output\ssm_ts_uv_00148.vtk', 'output\ssm_ts_uv_00149.vtk', 'output\ssm_ts_uv_00150.vtk', 'output\ssm_ts_uv_00151.vtk', 'output\ssm_ts_uv_00152.vtk', 'output\ssm_ts_uv_00153.vtk', 'output\ssm_ts_uv_00154.vtk', 'output\ssm_ts_uv_00155.vtk', 'output\ssm_ts_uv_00156.vtk', 'output\ssm_ts_uv_00157.vtk', 'output\ssm_ts_uv_00158.vtk', 'output\ssm_ts_uv_00159.vtk', 'output\ssm_ts_uv_00160.vtk', 'output\ssm_ts_uv_00161.vtk', 'output\ssm_ts_uv_00162.vtk', 'output\ssm_ts_uv_00163.vtk', 'output\ssm_ts_uv_00164.vtk', 'output\ssm_ts_uv_00165.vtk', 'output\ssm_ts_uv_00166.vtk', 'output\ssm_ts_uv_00167.vtk', 'output\ssm_ts_uv_00168.vtk', 'output\ssm_ts_uv_00169.vtk', 'output\ssm_ts_uv_00170.vtk'
(  60.190s) [paraview        ]       vtkExecutive.cxx:753    ERR| vtkPVCompositeDataPipeline (000001EBBD2C3270): Algorithm vtkFileSeriesReader(000001EBBCE3CD10) returned failure for request: vtkInformation (000001EBBB5AD520)
  Debug: Off
  Modified Time: 111671
  Reference Count: 1
  Registered Events: (none)

The files you are trying to open cannot be read or do not exists.

Hi Mathieu,
Thank you very much for your reply and comment! Actually, when I used paraview client GUI to read those VTk files, I didn’t run into any problems. Do you think it could be something wrong with the reader when I used pvpython to read it?

is that an actual path on your machine ?

Actually it’s not the full path. I shortened it a bit when I posted the question. But the path was generated by Trace in Paraview. Do you think the error is due to the format of path? Thank you!

So if I’m understanding you well, what you are doing is:

  • Tools → StartTrace
  • Open a file
  • Tools → Stop trace
  • Save python script
  • Close paraview
  • pvpython
  • failure to open files

Is that correct ?

You are correct!! I think I figured it out in the end, which is because my file’s path was changed for some reason when saved them as *.py from Trace. Anyway, thank you very much for your help, Mathieu!!!