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.<div>
<br></div><div>Utkarsh<br><br><div class="gmail_quote">On Tue, Nov 1, 2011 at 9:28 AM, David Dupuis <span dir="ltr"><<a href="mailto:david.dupuis@cadensimaging.com">david.dupuis@cadensimaging.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div lang="FR-CA" link="blue" vlink="purple"><div><p class="MsoNormal"><span lang="EN-CA">Hello,</span></p><p class="MsoNormal">
<span lang="EN-CA"> </span></p><p class="MsoNormal">
<span lang="EN-CA">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? </span></p>
<p class="MsoNormal"><span lang="EN-CA"> </span></p><p class="MsoNormal"><span lang="EN-CA">Here is what I tried to do so, but didn’t succeeded.</span></p><p class="MsoNormal"><span lang="EN-CA"> </span></p><p style="margin-left:0cm">
<span lang="EN-CA">1- I followed the procedure for Paraview/Python scripting, and added PYTHONPATH in .bashrc:</span></p><p class="MsoNormal"><span lang="EN-CA">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"</span></p>
<p class="MsoNormal"><span lang="EN-CA"> </span></p><p class="MsoNormal"><span lang="EN-CA">* 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...</span></p>
<p class="MsoNormal"><span lang="EN-CA"> </span></p><p class="MsoNormal"><span lang="EN-CA"> 2- I tried to load the python state file via python with the setup described at step 1, but got the following error:</span></p>
<p class="MsoNormal">
<span lang="EN-CA"> </span></p><p class="MsoNormal"><span lang="EN-CA">>> python ./sta.py </span></p><p class="MsoNormal"><span lang="EN-CA">Traceback (most recent call last):</span></p><p class="MsoNormal"><span lang="EN-CA"> File "/home/david/CADv2/Patients/P1/Prone/sta.py", line 2, in <module></span></p>
<p class="MsoNormal"><span lang="EN-CA"> except: from paraview.simple import *</span></p><p class="MsoNormal"><span lang="EN-CA"> File "/home/david/ParaView-3.12.0-RC2-Linux-x86_64/lib/paraview-3.12/site-packages/paraview/simple.py", line 39, in <module></span></p>
<p class="MsoNormal"><span lang="EN-CA"> import servermanager</span></p><p class="MsoNormal"><span lang="EN-CA"> File "/home/david/ParaView-3.12.0-RC2-Linux-x86_64/lib/paraview-3.12/site-packages/paraview/servermanager.py", line 43, in <module></span></p>
<p class="MsoNormal"><span lang="EN-CA"> import paraview, re, os, os.path, new, sys, vtk</span></p><p class="MsoNormal"><span lang="EN-CA"> 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></span></p>
<p class="MsoNormal"><span lang="EN-CA"> from vtkCommonPython import *</span></p><p class="MsoNormal"><span lang="EN-CA">ImportError: No module named vtkCommonPython</span></p><p class="MsoNormal"><span lang="EN-CA"> </span></p>
<p class="MsoNormal"><span lang="EN-CA">I have taken a look and there is no vtkCommonPython module on my machine. Is it part of the VTKPythonWrapping in Utilities?</span></p><p class="MsoNormal"><span lang="EN-CA"> </span></p>
<p class="MsoNormal"><span lang="EN-CA">Thanks for helping me with this one.</span></p><p class="MsoNormal"><span lang="EN-CA">David</span></p><p class="MsoNormal"><span lang="EN-CA"> </span></p><p class="MsoNormal"><span lang="EN-CA"> </span></p>
<p class="MsoNormal"><span lang="EN-CA"> </span></p><p class="MsoNormal"><img width="216" height="86" src="cid:image001.gif@01CC9872.08BC8CD0" alt="L_CadensImaging+rendering_C_gif"></p><p class="MsoNormal">
<span style="font-size:9.0pt"> </span></p><p class="MsoNormal"><span style="font-size:9.0pt">DAVID DUPUIS</span></p>
<p class="MsoNormal"><span style="font-size:9.0pt">Chef de produit | Product manager</span></p><p class="MsoNormal"><span style="font-size:9.0pt"> </span></p>
<p class="MsoNormal"><span style="font-size:9.0pt">116 principale, suite 200 </span></p><p class="MsoNormal"><span style="font-size:9.0pt">Granby (Qubec), J2G 2V2</span></p>
<p class="MsoNormal"><span lang="EN-CA" style="font-size:9.0pt">CANADA</span></p><p class="MsoNormal"><span lang="EN-CA" style="font-size:9.0pt"> </span></p>
<p class="MsoNormal"><span lang="EN-CA" style="font-size:9.0pt">T: <a href="tel:450.956.3456" value="+14509563456" target="_blank">450.956.3456</a> I Ext: 5114</span></p><p class="MsoNormal"><span lang="EN-CA" style="font-size:9.0pt">F: <a href="tel:450.991.3456" value="+14509913456" target="_blank">450.991.3456</a></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt"><a href="mailto:david.dupuis@cadensimaging.com" target="_blank">david.dupuis@cadensimaging.com</a></span></p><p class="MsoNormal"><span style="font-size:9.0pt"> </span></p>
<p class="MsoNormal"><b><span style="font-size:9.0pt">Avis :</span></b><span style="font-size:9.0pt"> 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.</span></p>
<p class="MsoNormal"><span style="font-size:9.0pt"> </span></p><p class="MsoNormal"><b><span lang="EN-CA" style="font-size:9.0pt">Notice:</span></b><span lang="EN-CA" style="font-size:9.0pt"> 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.</span></p>
<p class="MsoNormal"><span lang="EN-CA"> </span></p></div></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br></div>