# Error python-path

**URL:** https://discourse.paraview.org/t/error-python-path/14419
**Category:** Development
**Tags:** python
**Created:** [April 17, 2024, 11:43am UTC](https://discourse.paraview.org/t/error-python-path/14419 "2024-04-17T11:43:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![igel89](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/i/b487fb/32.png) [@igel89](https://discourse.paraview.org/u/igel89)
#### Post date: [April 17, 2024, 11:43am UTC](https://discourse.paraview.org/t/error-python-path/14419/1 "2024-04-17T11:43:31Z")

</div>

## Dear ParaView Team, I use Paraview to visualize gprMax data (ground penetrating radar). I get the following error message with Linux Mint:

## Traceback (last call): File “”, line 185, in File “/home/jan/Downloads/digital dike runner/ParaView-5.12.0-RC3-MPI-Linux-Python3.10-x86\_64/bin/../lib/python3.10/posixpath.py”, line 152, in dirname p = os.fspath(p) TypeError: expects str, bytes or os.PathLike object, not FileNameProperty

## and with Windows 11:

Traceback (last call):  
File “”, line 185, in   
File “C:\Program Files\ParaView 5.11.2\bin\lib\ntpath.py”, line 223, in dirname  
return split(p)[0]  
File “C:\Program Files\ParaView 5.11.2\bin\lib\ntpath.py”, line 185, in split  
p = os.fspath(p)  
TypeError: expects str, bytes or os.PathLike object, not FileNameProperty

This is a path error: How can this be fixed or which older python-gprMax-Parview version harmonizes?

best regards

Daniel

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [April 17, 2024, 12:58pm UTC](https://discourse.paraview.org/t/error-python-path/14419/2 "2024-04-17T12:58:10Z")

</div>

Welcome to the ParaView Discourse, @igel89.

Beginning with starting ParaView, what are the exact steps you are following that lead to this error?

The error is telling you that `p` in some code is passing in a FileNameProperty, which is an object that you can retrieve a path from, but is itself not a path. What is the Python code and where is it being defined?

If you have access to this code, change the `p` argument to `os.fspath(p)` to `p.GetElement(0)` and you should be good to go.

---

<div class="post-metadata">

### Author: ![igel89](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/i/b487fb/32.png) [@igel89](https://discourse.paraview.org/u/igel89)
#### Post date: [April 17, 2024, 2:06pm UTC](https://discourse.paraview.org/t/error-python-path/14419/3 "2024-04-17T14:06:12Z")

</div>

Thank you for your quick reply  
I use the program gprMax which works on python with miniconda. see install  
[http://docs.gprmax.com/en/latest/index.html](http://docs.gprmax.com/en/latest/index.html)

This program is integrated as a macro in Paraview  
[http://docs.gprmax.com/en/latest/output.html#geometry-output](http://docs.gprmax.com/en/latest/output.html#geometry-output)

Execution of gprMax in miniconda  
cd C:\Users\Igel\gprMax  
conda activate gprMax

To test an animation with standard example:  
[http://docs.gprmax.com/en/latest/examples\_advanced.html](http://docs.gprmax.com/en/latest/examples_advanced.html)

Since this is only a model and not an animation, the code for ‘snapshot’ is added as a loop ==\> .vti  
[http://docs.gprmax.com/en/latest/input.html#snapshot](http://docs.gprmax.com/en/latest/input.html#snapshot)

#python:  
for i in range(1, 31):  
print(‘#snapshot: x1 y1 z1 x2 y2 z2 dx dy dz {} snapshot{}’.format((i/10)\*1e-9, i))  
#end\_python:

Insert the parameters from the 14th line of heterogeneous\_soil.in  
print(‘#snapshot: 0 0 0 0.15 0.15 0.1 0.001 0.001 0.001 {} snapshot{}’.format((i/10)\*1e-9, i))

Execute  
python -m gprMax user\_models/heterogeneous\_soil.in

Start Paraview  
File/Open: user\_models/snapshot1.vti  
gprMax Macro activate

Previously the error message appeared here and when I change this from os.fspath(p) to p.GetElement(0) Paraview crashes.

---

<div class="post-metadata">

### Author: ![Yoyok\_Adisetio\_Lakso](https://discourse.paraview.org/user_avatar/discourse.paraview.org/yoyok_adisetio_lakso/32/15569_2.png) [@Yoyok\_Adisetio\_Lakso](https://discourse.paraview.org/u/Yoyok_Adisetio_Lakso)
#### Post date: [November 21, 2024, 2:46am UTC](https://discourse.paraview.org/t/error-python-path/14419/4 "2024-11-21T02:46:56Z")

</div>

I have this error, too. The error appears because I forgot to click Apply for the vti file in the Pipeline Browser. After clicking Apply, I run the gprmax\_info macro.
