Stat Paraview from Python script

Hi !

I am trying to launch Paraview from a Python script (Windows) but I got this message :
image

I have not problem to start the program from a .bat file but I don’t find any solution from python.

Do you have any solution ?

Thank you.

Best regards,

Hi @Marvin

How did you install ParaView ?

Best,

From zip file so no install.

Please try again with the last released version of ParaView from: https://www.paraview.org/download/

And share your script and how you run it.

I tried 2 ways :

  • Directly with Python
    program='C:/Users/XXXXXXX/Desktop/Paraview/ParaView-5.11.0-MPI-Windows-Python3.9-msvc2017-AMD64/bin/paraview.exe'
    subprocess.call([program])
  • By calling a shell script from python :
os.system('"run_postpro_mod.bat"')
START /wait C:\Users\XXXXXX\Desktop\Paraview\ParaView-5.11.0-MPI-Windows-Python3.9-msvc2017-AMD64\bin\paraview.exe --state C:\Users\XXXXXX\Desktop\SALOME-9.7.0\programme\FEA\mod.pvsm

Thanks for your help !

Can you try with 5.12.0 ?

Hi Mathieu,

I tried with 5.12.0 but no luck.

I just tried that and it worked perfectly:

>>> import subprocess
>>> program=r"C:\Users\glow\Desktop\paraview\ParaView-5.12.0-MPI-Windows-Python3.10-msvc2017-AMD64\bin\paraview.exe"
>>> subprocess.call(program)
0
>>>

Are you able to start paraview normally ?

Hi Mathieu,

I finally got the point. I tried to start paraview from a salome shell but even if it’s a python shell, it seems that some module like Qt are not loaded (or something like this).

Thank you for your help.