[vtkusers] Problem wraping vtk in Python-v2

sylvain.roy at sjgeophysics.com sylvain.roy at sjgeophysics.com
Thu Nov 20 22:00:57 EST 2008


I previously wrote:

""""""
Hello everyone,

I installed Python 2.5 and the source code of VTK on a Windows XP today. I
followed the directives to wrap vtk in python. I went throught CMake and
built the whole thing with mingw32-make.exe -i at the end. Everything
seemed fine. The bin folder is full of different files. After doing so, I
expected to go in python and type: import vtk, but it didn't work. Is it
normal?
If not, is there something I did wrong or some advices I could get.

Regards,
Sylvain
"""""""""

I made some improvement. In site-packages of Python25, I created a file
called vtk.pth containing:

C:\vtk-5.2.0\VTK_binary\Wrapping\Python
C:\vtk-5.2.0\VTK_binary\Wrapping\Python\vtk\tk
C:\vtk-5.2.0\VTK_binary\bin\release

Now, when I go in Python and write: import vtk, I get:

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import vtk
  File "C:/vtk-5.2.0/VTK_binary/Wrapping/Python\vtk\__init__.py", line 41,
in <module>
    from common import *
  File "C:/vtk-5.2.0/VTK_binary/Wrapping/Python\vtk\common.py", line 9, in
<module>
    from vtkCommonPython import *
ImportError: No module named vtkCommonPython

Someone has any idea?
Sylvain





More information about the vtkusers mailing list