# error occurs when read VTK file through pvpython

**URL:** https://discourse.paraview.org/t/error-occurs-when-read-vtk-file-through-pvpython/12128
**Category:** ParaView Support
**Tags:** vtk
**Created:** [May 20, 2023, 12:06am UTC](https://discourse.paraview.org/t/error-occurs-when-read-vtk-file-through-pvpython/12128 "2023-05-20T00:06:14Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![catiocean](https://discourse.paraview.org/user_avatar/discourse.paraview.org/catiocean/32/11663_2.png) [@catiocean](https://discourse.paraview.org/u/catiocean)
#### Post date: [May 20, 2023, 12:06am UTC](https://discourse.paraview.org/t/error-occurs-when-read-vtk-file-through-pvpython/12128/1 "2023-05-20T00:06:14Z")

</div>

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!

```auto
 # 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'
 paraview.simple._DisableFirstRenderCameraReset()

 # 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', '
output\\ssm_ts_uv_00170.vtk'""")

```

```auto
( 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)
  Request: REQUEST_DATA_OBJECT
  FORWARD_DIRECTION: 0
  ALGORITHM_AFTER_FORWARD: 1
```

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 22, 2023, 7:21am UTC](https://discourse.paraview.org/t/error-occurs-when-read-vtk-file-through-pvpython/12128/2 "2023-05-22T07:21:34Z")

</div>

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

---

<div class="post-metadata">

### Author: ![catiocean](https://discourse.paraview.org/user_avatar/discourse.paraview.org/catiocean/32/11663_2.png) [@catiocean](https://discourse.paraview.org/u/catiocean)
#### Post date: [May 22, 2023, 6:15pm UTC](https://discourse.paraview.org/t/error-occurs-when-read-vtk-file-through-pvpython/12128/3 "2023-05-22T18:15:05Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 23, 2023, 6:49am UTC](https://discourse.paraview.org/t/error-occurs-when-read-vtk-file-through-pvpython/12128/4 "2023-05-23T06:49:18Z")

</div>

> [@catiocean](#):
>
> `output\\ssm_ts_uv_00134.vtk`

is that an actual path on your machine ?

---

<div class="post-metadata">

### Author: ![catiocean](https://discourse.paraview.org/user_avatar/discourse.paraview.org/catiocean/32/11663_2.png) [@catiocean](https://discourse.paraview.org/u/catiocean)
#### Post date: [May 23, 2023, 9:49pm UTC](https://discourse.paraview.org/t/error-occurs-when-read-vtk-file-through-pvpython/12128/5 "2023-05-23T21:49:52Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 24, 2023, 6:49am UTC](https://discourse.paraview.org/t/error-occurs-when-read-vtk-file-through-pvpython/12128/6 "2023-05-24T06:49:40Z")

</div>

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 yourscript.py
- failure to open files

Is that correct ?

---

<div class="post-metadata">

### Author: ![catiocean](https://discourse.paraview.org/user_avatar/discourse.paraview.org/catiocean/32/11663_2.png) [@catiocean](https://discourse.paraview.org/u/catiocean)
#### Post date: [May 25, 2023, 9:00pm UTC](https://discourse.paraview.org/t/error-occurs-when-read-vtk-file-through-pvpython/12128/7 "2023-05-25T21:00:30Z")

</div>

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!!!
