[vtkusers] Trying to use VTK library in Python Interpreter

Hesam hesam.ilati2 at gmail.com
Tue Aug 28 14:21:11 EDT 2012


Thanks for your instructions. Actually I need to have VTK itself in Python.
Let me explain a little more:

Consier I have 2 external vtk libraries in the same folder and I want to
import them into the Python. (i.e. "vtkCommonPython" and
"vtkFilteringPython") and both of them have .pyd and .dll files.
(vtkCommonPython.pyd and vtkCommonPythonD.dll and same for other one)

Despite they are in same folder when I write down

import vtkCommonPython

it is fine, however when I want to import the other one

import vtkFilteringPython
ImportError: DLL load failed: The specified procedure could not be found.

I tried also to find from where first library is loaded using

vtkCommonPython.__file__

And it was the same folder's path for the other one.

How I can trace the problem and find problem's source.
Thanks
Hesam
On Tue, Aug 28, 2012 at 9:56 AM, David E DeMarle
<dave.demarle at kitware.com>wrote:

> 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
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120828/bb5b5b9d/attachment.htm>


More information about the vtkusers mailing list