[Paraview] Paraview Python scripting

David Dupuis david.dupuis at cadensimaging.com
Tue Nov 1 09:59:42 EDT 2011


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20111101/1a769a8e/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/1a769a8e/attachment-0001.gif>


More information about the ParaView mailing list