Sunday, July 26, 2015

how to setup vtk library on python

After download source code from here

1) Configure cmake including VTK_WRAP_PYTHON option. And then build it.


2) Compile the all source code. I suggest build it as release or optimized mode instead of debug mode.

3) Copy directory "Build\Wrapping\Python\vtk" (In my case "D:\vtk\VTK-6.1.0\bin\Wrapping\Python\vtk"), and paste the directory on "python\Lib\site-packages"

4) Copy all .dll files and .pyd files from "Build\bin\Release". Paste them on python\Lib\site-packages\vtk

Now, Setup is done. Let's practice with example. Copy the examples and paste, and run..


When you face the error, when using vtk on python

AttributeError: SetInput

You have to consider the replacement of setInput. Only thing you have to change is,.


SetInput -> SetInputConnection
Getoutput -> GetOutputPort

No comments:

Post a Comment