# How to revise plot\_dispwarp.py to plot in ParaView installed in Windows system?

**URL:** <https://community.geodynamics.org/t/how-to-revise-plot-dispwarp-py-to-plot-in-paraview-installed-in-windows-system/2461>\
**Category:** PyLith\
**Tags:** installation\
**Created:** [June 16, 2022, 2:54am UTC](https://community.geodynamics.org/t/how-to-revise-plot-dispwarp-py-to-plot-in-paraview-installed-in-windows-system/2461 "2022-06-16T02:54:35Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![LCmodeler](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/lcmodeler/32/1117_2.png) [@LCmodeler](https://community.geodynamics.org/u/LCmodeler)\
**Post date:** [June 16, 2022, 2:54am UTC](https://community.geodynamics.org/t/how-to-revise-plot-dispwarp-py-to-plot-in-paraview-installed-in-windows-system/2461/1 "2022-06-16T02:54:35Z")

</div>

Hi, for some reason, I have to use VirtualBox to run Pylith in my computer. However, there is not too much storage for my VirtualBox, so I installed Paraview in my Windows system. But as a new programmer, I don’t know how to revise the plot\_dispwarp.py file to let my Paraview read all of the files that it needs to compile the program into a virtual plot. Below is the error info when I run python shell in Paraview.

Traceback (most recent call last):  
File “”, line 152, in   
File “”, line 56, in visualize  
OSError: File ‘output\step01\_axialdisp-domain.xmf’ does not exist.

By the way, I have tried to copy output folder and plot\_dispwarp.py to Windows system and revise the path lines in the plot\_dispwarp.py to plot but I failed.

I guess I need to revise somewhere of plot\_dispwarp.py file to make it plot but I don’t know how. Thanks for help!

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [June 16, 2022, 3:25am UTC](https://community.geodynamics.org/t/how-to-revise-plot-dispwarp-py-to-plot-in-paraview-installed-in-windows-system/2461/2 "2022-06-16T03:25:06Z")

</div>

For Windows, we recommend using the Windows Subsystem for Linux rather than a virtual box. This makes it easier to access files generated within Linux from Windows and vice versa.

Regardless of your operating system, if you launch ParaView from a directory other than where you ran PyLith (for example, `examples/box-2d`), then you need to set `OUTPUT_DIR` in the ParaView Python shell to the absolute path to where the `.h5` and `.xmf` files are located **before** running the Python script. For example, if the output files are in (using Linux directory structure) `$HOME/src/cig/pylith/examples/box-2d/output`, then in the ParaView Python Shell:

```auto
import os
OUTPUT_DIR = os.path.join(os.environ["HOME"], "src", "cig", "pylith", "examples", "box-2d", "output")

```

This is documented at the top of the Python script, but I will add it to the manual.

---

<div class="post-metadata">

**Author:** ![LCmodeler](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/lcmodeler/32/1117_2.png) [@LCmodeler](https://community.geodynamics.org/u/LCmodeler)\
**Post date:** [June 16, 2022, 4:55pm UTC](https://community.geodynamics.org/t/how-to-revise-plot-dispwarp-py-to-plot-in-paraview-installed-in-windows-system/2461/3 "2022-06-16T16:55:47Z")

</div>

Thanks for your answer. That’s the exactly the part where i think I should change the code. But could you please show me how to use Windows directory structure to change the command lines of absolute path. My output folder is saved in this path:  
C:\Users\HeLingChao\Downloads\output

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [June 16, 2022, 5:13pm UTC](https://community.geodynamics.org/t/how-to-revise-plot-dispwarp-py-to-plot-in-paraview-installed-in-windows-system/2461/4 "2022-06-16T17:13:19Z")

</div>

```auto
import os
OUTPUT_DIR = os.path.abspath(os.path.join("Users","HeLingChao","Downloads", "output"))

```

Using `os.path.abspath()` should add the drive letter on Windows.

---

<div class="post-metadata">

**Author:** ![LCmodeler](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/lcmodeler/32/1117_2.png) [@LCmodeler](https://community.geodynamics.org/u/LCmodeler)\
**Post date:** [June 16, 2022, 6:52pm UTC](https://community.geodynamics.org/t/how-to-revise-plot-dispwarp-py-to-plot-in-paraview-installed-in-windows-system/2461/5 "2022-06-16T18:52:28Z")

</div>

Thanks for help. I tried this code but ParaView still shows:  
Traceback (most recent call last):  
File “”, line 151, in   
File “”, line 55, in visualize  
OSError: File ‘output\step01\_axialdisp-domain.xmf’ does not exist.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/geodynamics/original/2X/7/79fbf908fb37e52cb1f98d2545fd8ab60093539d.png)

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [June 16, 2022, 7:23pm UTC](https://community.geodynamics.org/t/how-to-revise-plot-dispwarp-py-to-plot-in-paraview-installed-in-windows-system/2461/6 "2022-06-16T19:23:51Z")

</div>

There is no need to edit the `plot_dispwarp.py` script. In this case, you edited the comment, so it has no effect. You need to set `OUTPUT_DIR` in the ParaView Python Shell (see screenshot below) before clicking on the `Run Script` button.

 ![screenshot](https://canada1.discourse-cdn.com/flex036/uploads/geodynamics/original/2X/4/45b82be18cb33c45f3bc3aa3e68180291f3d2a8c.png)

---

<div class="post-metadata">

**Author:** ![LCmodeler](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/lcmodeler/32/1117_2.png) [@LCmodeler](https://community.geodynamics.org/u/LCmodeler)\
**Post date:** [June 16, 2022, 7:31pm UTC](https://community.geodynamics.org/t/how-to-revise-plot-dispwarp-py-to-plot-in-paraview-installed-in-windows-system/2461/7 "2022-06-16T19:31:24Z")

</div>

It is fixed! Thanks for your patience!

---

<div class="post-metadata">

**Author:** ![chenyq](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@chenyq](https://community.geodynamics.org/u/chenyq)\
**Post date:** [March 31, 2024, 9:03am UTC](https://community.geodynamics.org/t/how-to-revise-plot-dispwarp-py-to-plot-in-paraview-installed-in-windows-system/2461/8 "2024-03-31T09:03:32Z")

</div>

Hi, I already set the absolute path in the paraview shell in term of above, but when run the file(.py) occur the below prolem, why?

 ![微信截图_20240331170312](https://canada1.discourse-cdn.com/flex036/uploads/geodynamics/original/2X/9/91b35eb4d5e4d4814e508b4c5a30e5fee2b8c242.jpeg)

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [March 31, 2024, 7:00pm UTC](https://community.geodynamics.org/t/how-to-revise-plot-dispwarp-py-to-plot-in-paraview-installed-in-windows-system/2461/9 "2024-03-31T19:00:31Z")

</div>

Please provide more information about what commands you are running.

I am confused by your explanation, because `mesh_tri.exo` is never used in `plot_dispwarp.py`. What script are you running? What are you trying to visualize?

---

<div class="post-metadata">

**Author:** ![chenyq](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@chenyq](https://community.geodynamics.org/u/chenyq)\
**Post date:** [April 1, 2024, 1:47pm UTC](https://community.geodynamics.org/t/how-to-revise-plot-dispwarp-py-to-plot-in-paraview-installed-in-windows-system/2461/10 "2024-04-01T13:47:42Z")

</div>

![微信截图_20240401214722](https://canada1.discourse-cdn.com/flex036/uploads/geodynamics/original/2X/8/844fb03142b434e095e151ff87a724786f3e5f43.jpeg)

I followed the pylith4.0.0‘s video tutorial and after entering the above code, when I run the script plot\_dispwarp.py in paraview, it prompts the above error, while there is no error inside the video tutorial, why?

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [April 1, 2024, 2:16pm UTC](https://community.geodynamics.org/t/how-to-revise-plot-dispwarp-py-to-plot-in-paraview-installed-in-windows-system/2461/11 "2024-04-01T14:16:22Z")

</div>

I am assuming you started ParaView from a shortcut or application icon, then you need to set the OUTPUT\_DIR variable. Assuming the absolute path the PyLith installation directory is is “\programfile\pylith”, you would do the following:

```auto
import os
OUTPUT_DIR = os.path.join("programfile", "pylith", "examples", "reverse-2d", "output")
SIM = "step08_onefault"
FIELD_COMPONENT = "X"

```

Then click on the `Run Script` button, and navigate to the `plot_dispwarp.py` script in `examples/reverse-2d/viz`.

If you installed PyLith to a different directory, then you will need to update the OUTPUT\_DIR line. Note that it points to the `output` directory where the simulation output was written.

---

<div class="post-metadata">

**Author:** ![chenyq](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@chenyq](https://community.geodynamics.org/u/chenyq)\
**Post date:** [April 1, 2024, 2:42pm UTC](https://community.geodynamics.org/t/how-to-revise-plot-dispwarp-py-to-plot-in-paraview-installed-in-windows-system/2461/12 "2024-04-01T14:42:39Z")

</div>

Thank you. The Problem has been solved through your guide.

---

<div class="post-metadata">

**Author:** ![chenyq](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@chenyq](https://community.geodynamics.org/u/chenyq)\
**Post date:** [April 2, 2024, 5:10am UTC](https://community.geodynamics.org/t/how-to-revise-plot-dispwarp-py-to-plot-in-paraview-installed-in-windows-system/2461/13 "2024-04-02T05:10:44Z")

</div>

Hello, I encounter the problem when I run the step01\_gravity.cfg file, the problem is “ **nemesis: error while loading shared libraries: libmpi.so.12: cannot open shared object file: No such file or directory** ”

. I find the answer

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [April 4, 2024, 2:18pm UTC](https://community.geodynamics.org/t/how-to-revise-plot-dispwarp-py-to-plot-in-paraview-installed-in-windows-system/2461/14 "2024-04-04T14:18:33Z")

</div>

These errors indicate something is incorrect with your environment or how you are running PyLith. These are difficult issues to debug without knowing much more information about how your computer is setup, how you installed PyLith, and what commands you are running. Here are some things you can do to help us debug the problem. Please show what you entered into the terminal and _all_ of the output.

1. What operating system are you using? If Windows, are you using the Windows Subsystem for Linux?
2. What shell are you using? Usually, you can run `echo $SHELL` to display the shell.
3. How did you install PyLith? If using a binary, which one did you download and where did you unpack it?
4. What is the output of `echo $PATH`?
5. What is the output of `echo $LD_LIBRARY_PATH`?
6. What is the output of `which nemesis`?
7. What is the output of `ldd $(which nemesis)`?
8. What is the output of `ldd $(which mpinemesis)`?
9. What is the output of `pylith --version`?

---

<div class="post-metadata">

**Author:** ![chenyq](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@chenyq](https://community.geodynamics.org/u/chenyq)\
**Post date:** [April 5, 2024, 9:14am UTC](https://community.geodynamics.org/t/how-to-revise-plot-dispwarp-py-to-plot-in-paraview-installed-in-windows-system/2461/15 "2024-04-05T09:14:09Z")

</div>

1. What operating system are you using? If Windows, are you using the Windows Subsystem for Linux?  
Answer: my operating system is Windows. Yes, it’s the Windows Subsystem for Linux
2. What shell are you using? Usually, you can run `echo $SHELL` to display the shell.  
 ![1](https://canada1.discourse-cdn.com/flex036/uploads/geodynamics/original/2X/1/15c28c23e5fad783a3741bea9c131aa574817bff.png)
3. How did you install PyLith? If using a binary, which one did you download and where did you unpack it?  
Answer: I installed the ‘pylith-4.0.0’, and unpack in the `D:\pylith\`
4. What is the output of `echo $PATH`?  
 ![2](https://canada1.discourse-cdn.com/flex036/uploads/geodynamics/original/2X/4/48b351ca7b8c802f0253b2ec6aa49e28c574592c.png)
5. What is the output of `echo $LD_LIBRARY_PATH`?  
 ![3](https://canada1.discourse-cdn.com/flex036/uploads/geodynamics/original/2X/a/a9e5beec87631b6c414aef85d64dbd36302ebea9.png)
6. What is the output of `which nemesis`?  
`/mnt/d/pylith/pylith-4.0.0-linux-x86_64/bin/nemesis`
7. What is the output of `ldd $(which nemesis)`?  
 ![4](https://canada1.discourse-cdn.com/flex036/uploads/geodynamics/original/2X/7/7ed9f77457dc1f418292d29c96b97309c1009366.png)
8. What is the output of `ldd $(which mpinemesis)`?  
 ![5](https://canada1.discourse-cdn.com/flex036/uploads/geodynamics/original/2X/3/3fad0dda783fe3320e260bdb8d9b0ed1bc0280ee.png)
9. What is the output of `pylith --version`?  
 ![6](https://canada1.discourse-cdn.com/flex036/uploads/geodynamics/original/2X/2/28e0326c16449b69777237a8909e4b004bbe202a.png)

---

<div class="post-metadata">

**Author:** ![chenyq](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@chenyq](https://community.geodynamics.org/u/chenyq)\
**Post date:** [April 5, 2024, 9:16am UTC](https://community.geodynamics.org/t/how-to-revise-plot-dispwarp-py-to-plot-in-paraview-installed-in-windows-system/2461/16 "2024-04-05T09:16:01Z")

</div>

Thank you very much. I reunpacked and reinstalled, it’s fixed, thank you for your patience.
