Load python script that is not in the current working directory from the comand line


I am trying to control Paraview using the macro (Python script). I know that I can load a Python script from the command line by adding a flag:

paraview --script=input.py

What if this “input.py” is not in the current working directory? So, I tried to give the full path to the Python script:

paraview --script= C:/sample/scripts/input.py

But it does not work. Paraview complains that it cannot open the file. Any suggestions?


It looks like you have a space between your equal sign and the C. I think you need to remote that and it will work. With ParaView v5.8 I can load a script with an absolute path.

Thank you so much for the help. The space was an accident due to copy and paste, but I have resolved this issue.

how did you solve it ?

I did in a tricky way by moving the target python script to the current working directory and read it without the original path in the command line.