[Paraview] basic python paraview setup question
Moreland, Kenneth
kmorel at sandia.gov
Fri Jan 23 11:40:42 EST 2009
First, I would like to mention that the ParaView binaries come with a program called pvpython that is basically just a python interpreter with the paths set up.
That said, I understand that it is not always practical to use pvpython in lieu of the default python interpreter, so to actually answer your question, you also have to add this to your PYTHONPATH
/home/sree/paraview-3.4.0/Utilities/VTKPythonWrapping
After that, python should find the paraview module.
Although not strictly necessary, I also recommend calling paraview.servermanager.vtkInitializationHelper.Finalize() right before your script exits. This will make sure that all the VTK object get cleaned up nicely and is one of the other things that pvpython will do for you.
-Ken
On 1/23/09 8:59 AM, "Sreejith Kuttanikkad" <sreejithpk at gmail.com> wrote:
Dear Paraview,
I can't get python scripting working with paraview. I have downloaded paraview binary 3.4.0 for linux and set pythonpath by
export PYTHONPATH="/home/sree/paraview-3.4.0/lib/paraview-3.4/paraview/:/home/sree/paraview-3.4.0/bin/" in .bashrc file
and in python when i printed the paths it showed the paraview paths:
print sys.path
['', '/home/sree/paraview-3.4.0/lib/paraview-3.4/paraview', '/home/sree/paraview-3.4.0/bin'.... ]
however when i followed commands as given in http://www.paraview.org/Wiki/ParaView/Python_Scripting
the following error occured.
>>> from paraview import servermanager
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named paraview
what I am missing here.. ?
thanks,
Sreejith
**** Kenneth Moreland
*** Sandia National Laboratories
***********
*** *** *** email: kmorel at sandia.gov
** *** ** phone: (505) 844-8919
*** web: http://www.cs.unm.edu/~kmorel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20090123/b9e5e453/attachment.htm>
More information about the ParaView
mailing list