[Paraview] Paraview Python scripting

David Dupuis david.dupuis at cadensimaging.com
Tue Nov 1 10:13:01 EDT 2011


Sta.py is a Python state file I have created using "Save state" in the GUI.
Yes, it needs to open the GUI and load the whole pipeline saved in the
Python State file.



*De :* Adriano Gagliardi [mailto:agagliardi at ara.co.uk]
*Envoyé :* 1 novembre 2011 10:07
*À :* 'David Dupuis'; 'Utkarsh Ayachit'
*Cc :* paraview at paraview.org
*Objet :* RE: [Paraview] Paraview Python scripting



What does sta.py do that it needs to open the GUI? Do you mean an X11
window?



===================================

Adriano Gagliardi MEng PhD
Business Sector Leader
Computational Aerodynamics
Aircraft Research Association Ltd.
Manton Lane
Bedford

Tel: 01234 32 4644
E-mail: agagliardi at ara.co.uk
Url: www.ara.co.uk




------------------------------

*From:* paraview-bounces at paraview.org [mailto:paraview-bounces at paraview.org]
*On Behalf Of *David Dupuis
*Sent:* 01 November 2011 14:00
*To:* Utkarsh Ayachit
*Cc:* paraview at paraview.org
*Subject:* Re: [Paraview] Paraview Python scripting

Hello Utkarsh,



The Python Shell works fine.



On the other hand, if you mean using  pvpython this way:



>> /home/david/ParaView-3.12.0-RC2-Linux-x86_64/bin/pvpython ./sta.py



It doesn't work... The GUI will   flash  (open partially and shutdown
quickly) and we cannot see anything...



Thanks again!

David



*De :* Utkarsh Ayachit [mailto:utkarsh.ayachit at kitware.com]
*Envoyé :* 1 novembre 2011 09:35
*À :* David Dupuis
*Cc :* paraview at paraview.org
*Objet :* Re: [Paraview] Paraview Python scripting



Have you tried using the pvpython executable? It's sets up the environment
correctly for you. Alternatively, from the GUI, you can open the Python
Shell and and then use the "Load Script" button to load the script.



Utkarsh

On Tue, Nov 1, 2011 at 9:28 AM, David Dupuis <david.dupuis at cadensimaging.com>
wrote:

Hello,



I'm manipulating different dataset and for each of them I have a different
setup (pipeline). I saved the state as a python file and plan to re-use the
python state file to re-open the whole pipeline for each dataset. It seems
that only *.psvm files can be loaded via   File -> Load state  in Paraview.
Is there a way to load a python state file?



Here is what I tried to do so, but didn't succeeded.



1- I followed the procedure for Paraview/Python scripting, and added
PYTHONPATH in .bashrc:

export
PYTHONPATH="/home/david/ParaView-3.12.0-RC2-Linux-x86_64/lib/paraview-3.12/site-packages/:/home/david/ParaView-3.12.0-RC2-Linux-x86_64/bin"



* The only thing I can't do is adding the path to
="/home/david/ParaView-3.12.0-RC2-Linux-x86_64/Utilities/VTKPythonWrapping/site-packages 
since I don't have any  Utilities  folder in my Paraview directory. I
believe this is required, but don't know what to install and where to get
it to have it...



2- I tried to load the python state file via python with the setup
described at step 1, but got the following error:



>> python ./sta.py

Traceback (most recent call last):

  File "/home/david/CADv2/Patients/P1/Prone/sta.py", line 2, in <module>

    except: from paraview.simple import *

  File
"/home/david/ParaView-3.12.0-RC2-Linux-x86_64/lib/paraview-3.12/site-packages/paraview/simple.py",
line 39, in <module>

    import servermanager

  File
"/home/david/ParaView-3.12.0-RC2-Linux-x86_64/lib/paraview-3.12/site-packages/paraview/servermanager.py",
line 43, in <module>

    import paraview, re, os, os.path, new, sys, vtk

  File
"/home/david/ParaView-3.12.0-RC2-Linux-x86_64/lib/paraview-3.12/site-packages/paraview/vtk/__init__.py",
line 1, in <module>

    from vtkCommonPython import *

ImportError: No module named vtkCommonPython



I have taken a look and there is no vtkCommonPython module on my machine.
Is it part of the VTKPythonWrapping in Utilities?



Thanks for helping me with this one.

David







[image: L_CadensImaging+rendering_C_gif]



DAVID DUPUIS

Chef de produit | Product manager



116 principale, suite 200

Granby (Qubec), J2G 2V2

CANADA



T: 450.956.3456 I Ext: 5114

F: 450.991.3456

david.dupuis at cadensimaging.com



*Avis :* Ce message est confidentiel et est à l'usage exclusif de son
destinataire.  Il est strictement interdit à toute autre personne de le
diffuser, le distribuer ou le reproduire.  Si le destinataire ne peut être
joint ou vous est inconnu, veuillez informer l'expéditeur par courrier
électronique immédiatement et effacer ce message et en détruire toute
copie. Les communications par Internet sont exposées au risque d'altération
des données,  d'autres erreurs de transmission et  la perte de
confidentialité. Si vous désirez que nous communiquions avec vous par un
autre moyen, veuillez nous en aviser.



*Notice:* This message is confidential and is intended for the exclusive
use of the addressee.  Any other person is strictly prohibited from
disclosing, distributing or reproducing it.  If the addressee cannot be
reached or is unknown to you, please inform the sender by return e-mail
immediately and delete this message and destroy all copies. Internet
communications are subject to the risk of data corruption, other
transmission errors and loss of confidentiality. Please advise if you wish
us to use a different method when communicating with you.




_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at:
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview



**********************************************************************
This email contains information that is private and confidential and is
intended only for the addressee.
If you are not the intended recipient please delete it and notify us
immediately by e-mailing the sender.
Note: All email sent to or from this address may be accessed by someone
other than the recipient, for
system management and security reasons.
Aircraft Research Association Ltd.  Registered in England, Registration No
503668 Registered Office:
Manton Lane, Bedford MK41 7PF England VAT No GB 196351245

**********************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20111101/9c9ba3f4/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 6583 bytes
Desc: not available
URL: <http://www.paraview.org/pipermail/paraview/attachments/20111101/9c9ba3f4/attachment-0001.gif>


More information about the ParaView mailing list