MantisBT - ParaView
View Issue Details
0006457ParaView(No Category)public2008-02-27 15:062009-05-13 13:59
Ken Moreland 
Berk Geveci 
highminoralways
closedno change required 
 
3.43.4 
0006457: Programmable filter does not work with "plain" Python
If you set up your paths correctly, it is possible to script ParaView with the basic python executable (as opposed to pvpython). However, one feature that never seems to work is the programmable filter. Whenever the programmable filter is created from the basic python executable, it cannot import the ParaView module.

The same process works fine in pvpython.
No tags attached.
Issue History
2008-02-27 15:06Ken MorelandNew Issue
2008-03-18 18:59Alan ScottPrioritynormal => high
2008-03-19 20:01Berk GeveciStatusbacklog => tabled
2008-03-19 20:01Berk GeveciAssigned To => Berk Geveci
2008-03-19 20:02Berk GeveciTarget Version => Python support
2008-04-02 16:23Berk GeveciNote Added: 0011043
2008-04-02 16:23Berk GeveciStatustabled => @20@
2008-04-09 19:22Greg WeirsNote Added: 0011233
2008-04-17 17:18Berk GeveciStatus@20@ => @80@
2008-04-17 17:18Berk GeveciResolutionopen => no change required
2008-04-17 20:51Alan ScottStatus@80@ => closed
2008-04-17 20:51Alan ScottNote Added: 0011428
2009-05-13 13:58Utkarsh AyachitTarget VersionPython support => 3.4
2009-05-13 13:59Utkarsh AyachitFixed in Version => 3.4
2011-06-16 13:10Zack GalbreathCategory => (No Category)

Notes
(0011043)
Berk Geveci   
2008-04-02 16:23   
I cannot reproduce this on my Mac. I have the following:

I am running paraview from the build tree. My Python path is:
/Users/berk/Work/paraview3-build/bin:/Users/berk/Work/paraview3-build/Utilities/VTKPythonWrapping

When I run the following script using python, it all works fine.

from paraview import servermanager

servermanager.Connect()

source = servermanager.sources.ProgrammableSource()
source.GetProperty("Script").SetElement(0, """
from paraview import vtk
from paraview import servermanager
""")
source.UpdatePipeline()
(0011233)
Greg Weirs   
2008-04-09 19:22   
In this example, I don't think the programmable filter script is being executed. When I add a print statement to it, nothing is printed. If I try to import "utils" rather than "util", there are no complaints.

In the first three lines of the python script I set the path explicitly, rather than relying on the PYTHONPATH.


import sys
sys.path.insert(0,'/usr/local/building/Paraview3/Utilities/VTKPythonWrapping')
sys.path.insert(0,'/usr/local/building/Paraview3/bin')

from paraview import servermanager

servermanager.Connect()


source = servermanager.sources.ProgrammableSource()
source.GetProperty("Script").SetElement(0, """
import sys
print "sys.path = ", sys.path

from paraview import vtk
from paraview import util
from paraview import servermanager
""")
source.UpdatePipeline()
(0011428)
Alan Scott   
2008-04-17 20:51   
Closed, as per Berk.