[vtkusers] Trying to use VTK library in Python Interpreter

David E DeMarle dave.demarle at kitware.com
Tue Aug 28 09:56:56 EDT 2012


Another solution is to make sure you have all of the required vtk
libraries and python modules in your PATH and PYTHONPATH respectively.
(Or ld_library_path if not windows.)

pythonpath should contain both vtkbld/bin and
vtkbld/vtkPythonWrapping, and path should have vtkbld/bin .

See http://paraview.org/Wiki/ParaView/Python_Scripting getting started
for more details.

David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909


On Tue, Aug 28, 2012 at 3:39 AM, Heidler, Kirstin (GE Oil & Gas)
<Kirstin.Heidler at ge.com> wrote:
> Hello Hesam,
>
>
>
> I had some troubles installing VTK for python. Somehow the libraries were
> not properly linked.
>
> I did not solve that error, but I found a different solution which works
> very well.
>
>
>
> http://www.lfd.uci.edu/~gohlke/pythonlibs/
>
>
>
> On this page you can find an executable which installs VTK for python. (just
> search for vtk on the page)
>
>
>
> Afterwards, when you try to import vtk, it fails the first time, but works
> the second time and any afterward. (Not sure why that happens I suppose it
> has something to do with unbuilt binaries)
>
>
>
> Cheers,
>
> Kirstin
>
>
>
> Von: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] Im Auftrag
> von Hesam
> Gesendet: Montag, 27. August 2012 19:39
> An: vtkusers at vtk.org
> Betreff: [vtkusers] Trying to use VTK library in Python Interpreter
>
>
>
> Hi all,
>
> Goal: Trying to use VTK library in Python Interpreter.
>
> What I did: I have installed VTK using CMake with option VTK_WRAP_PYTHON and
> Shared_Library enabled and build the VTK in visual studio and it has
> finished with all builds successfully. Then I made the Python_Path.
>
> Problem: When I try to import vtk library into python, I get the following
> error message:
>
>
>
>>>> import vtk
>
>
> Traceback (most recent call last):
>
>   File "<pyshell#0>", line 1, in <module>
>
>     import vtk
>
>   File "...\VTK\VTKvisual\Wrapping\Python\vtk\__init__.py", line 42, in
> <module>
>
>     from vtkFilteringPython import *
>
> ImportError: No module named vtkFilteringPython
>
> Any thoughts that why this is happening?
>
> Thanks
>
>
> _______________________________________________
> 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 VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list