Python 2.5 enabled VTK 5.2 Windows binaries

You can always check my Latest VTK Windows binaries page to make sure you have the latest blog posting and hence the latest binaries.

I’ve made available my home-baked VTK 5.2 Windows binaries.  These have my special python-exception-patches integrated and have been built with Visual Studio 2005 (8.0) SP1 on Windows XP2 with full Python 2.5 support.  Get the binaries (or my patched source) by going here.  You want the binaries if you want to use VTK from Python.

IMPORTANT: you might have to install the MS VS2005 vcredist_x86 package (free!) if you want to use these DLLs (thanks Jelle for pointing this out).  This might not be necessary if you already have one or more of the MS development environments installed.

Please leave a comment on this blog posting if you use these or just hate them. It’s almost like postcard-ware, but with blog comments. Please also link to this page and not directly to the download location, thanks!

To use this from Python, you need to add the following to your PATH:

  • d:\opt\VTK\bin

You also need to add all of the above to PYTHONPATH, as well as the following:

  • d:\opt\VTK\lib\site-packages

… where d:\opt is the drive and directory where you unpacked the ZIP file.
Once you’ve done this and logged out and in again, “import vtk” should work at the Python prompt. Shameless plug: you can use my free envedit software to do the environment editing. It beats the default XP editing thingy.

12 Comments to “Python 2.5 enabled VTK 5.2 Windows binaries”

  1. Lukas Batteau said...
    September 24, 2008

    Great work. I’ve finally managed to build everything from source and get it working myself, but this is really handy!

  2. Scott said...
    September 27, 2008

    awesome. thank you.

  3. Nam Nguyen said...
    September 30, 2008

    Hi,
    This is very helpful. Can you explain step by step about how to add PATH like:
    =======================================
    To use this from Python, you need to add the following to your PATH:

    * d:\opt\VTK\bin

    You also need to add all of the above to PYTHONPATH, as well as the following:

    * d:\opt\VTK\lib\site-packages
    =======================================

    Thanks a lot.

  4. Guigounet said...
    October 15, 2008

    Hi!

    First of all, I am to thank you for your vtk dll’s. I have been trying to compile and build from source with MinGw first, Cygwin secondly, and Cmake for 2 days but I fail to achieve vtk wrapping python installation on my XP os. So thank’s again.

    However, I want to create a tk widget to render into and pack it in a python Pmw GUI. But there is a dll missing, vtkRenderingPythonTkWidgets.dll, to instanciate it.
    Any help please?

    Best regards.

    Guy

  5. Andrej Varchola said...
    October 31, 2008

    Thank you, it is very useful.

  6. Marten said...
    November 6, 2008

    Thanks a lot! Works very well with Python 2.5.2!

  7. Rafael Goncalves said...
    November 12, 2008

    I’ve to thank you for these binaries. It was impossible to compile with g++ here. That said, I’m having some problems here, look:

    Traceback (most recent call last):
    File “”, line 1, in
    import vtk
    File “C:\vtk\lib\site-packages\vtk\__init__.py”, line 41, in
    from common import *
    File “C:\vtk\lib\site-packages\vtk\common.py”, line 9, in
    from vtkCommonPython import *
    ImportError: DLL load failed: Module not found.

    Since tha PATH and the PYTHONPATH are already ok, what should I do?

  8. cpbotha said...
    November 13, 2008

    @Rafael Goncalves:

    Your PATH should contain C:\vtk\bin and your PYTHONPATH should contain *both* c:\vtk\bin;c:\vtk\lib\site-packages

    Is this the case?

    Are you also sure that you have the vcredist package installed?

  9. Cookie said...
    November 14, 2008

    Hi cpbotha,
    It’s very good that these packages run well under python25! You are great! But when I cake sth. with itk3.8 package and then build in vs2005, there is an error like this:

    2>Cannot find SWIG Lib directory. Checked:
    2> C:/build/jwd/archive/Insight/Utilities/CableSwig/SWIG/Lib

    I checked the itk package, and found in the fiel “gdcmConfigure.h” there is a line

    #define PUB_DICT_PATH “C:/build/jwd/inst/Insight/share/gdcm/”

    and in the file “vcl_where_root_dir.h”
    #define VCL_SOURCE_ROOT_DIR “C:/build/jwd/archive/Insight/Utilities/vxl”

    I wish to know are there any other files influencing the later cmaking vcproj file. And do you have any other better ideas than change by hand?

  10. Rafael Goncalves said...
    November 14, 2008

    Yes, thats the case.

    Lukas:
    How did you manage to compile it? I’ve tryed with mingcw and VS9 but it went wrong all the times.

  11. Lukas said...
    November 14, 2008

    @Rafael:

    I’ve compiled several versions of VTK without any problems in VS8 (2005). Are you using CMake?

  12. Tatiana said...
    November 17, 2008

    To Lukas:
    Have you tried to compile ITK in VS2005 using CMake? I have compiled ITK for general python environment. But when I setted ITK_USE_REVIEW and USE_WRAP_ITK to ON , there are several errors…

*

*