[Insight-users] Python Wrappers - WinXP

Matt McCormick matt.mccormick at kitware.com
Wed Oct 31 11:20:22 EDT 2012


Hi Peter,

If using PYTHONPATH to specify the location of the .py files, PATH
also needs to be set to specify the location of the DLL's.

HTH,
Matt

On Wed, Oct 31, 2012 at 10:37 AM, Peter M. Bloomfield
<peter.bloomfield at camhpet.ca> wrote:
>
>
> Hi,
>
>
>
> I am experiencing a problem with python wrapping. I have the following on a
> 32-bit WinXP machine
>
> Visual Studio 9 2008
>
> ITK V4.2.1
>
> Python 2.7.2
>
>
>
> I have selected 'ITK_WRAP_PYTHON' and 'BUILD_SHARED_LIBS' and set
> 'CMAKE_INSTALL_PREFIX' to C:\CAMH\ITK within cmake, and all compiles and
> installs without error in VS 2008.
>
>
>
> I have set a PYTHONPATH to include both
>
> C:\CAMH\ITK\lib\ITK-4.2\Python
>
> C:\CAMH\ITK\lib
>
> though I am not sure if I have these correct. I can import itk from within
> python, but get an error when issuing the command
>
> image_type = itk.Image[itk.F, 3]
>
> as shown below.
>
>
>
> Microsoft Windows XP [Version 5.1.2600]
>
> (C) Copyright 1985-2001 Microsoft Corp.
>
>
>
> C:\Documents and Settings\Peter>python
>
> Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on
> win32
>
> Type "help", "copyright", "credits" or "license" for more information.
>
>>>> import itk
>
>>>> image_type = itk.Image[itk.F, 3]
>
> Traceback (most recent call last):
>
> File "<stdin>", line 1, in <module>
>
> File "C:\CAMH\ITK\lib\ITK-4.2\Python\itkLazy.py", line 37, in
> __getattribute__
>
> itkBase.LoadModule(module, namespace)
>
> File "C:\CAMH\ITK\lib\ITK-4.2\Python\itkBase.py", line 95, in LoadModule
>
> LoadModule(dep, namespace)
>
> File "C:\CAMH\ITK\lib\ITK-4.2\Python\itkBase.py", line 95, in LoadModule
>
> LoadModule(dep, namespace)
>
> File "C:\CAMH\ITK\lib\ITK-4.2\Python\itkBase.py", line 95, in LoadModule
>
> LoadModule(dep, namespace)
>
> File "C:\CAMH\ITK\lib\ITK-4.2\Python\itkBase.py", line 95, in LoadModule
>
> LoadModule(dep, namespace)
>
> File "C:\CAMH\ITK\lib\ITK-4.2\Python\itkBase.py", line 103, in LoadModule
>
> if not swigModuleName in sys.modules: module = loader.load(swigModuleName)
>
> File "C:\CAMH\ITK\lib\ITK-4.2\Python\itkBase.py", line 214, in load
>
> return imp.load_module(name, fp, pathname, description)
>
> File "C:\CAMH\ITK\lib\ITK-4.2\Python\ITKCommonPython.py", line 30, in
> <module>
>
> _ITKCommonPython = swig_import_helper()
>
> File "C:\CAMH\ITK\lib\ITK-4.2\Python\ITKCommonPython.py", line 26, in
> swig_import_helper
>
> _mod = imp.load_module('_ITKCommonPython', fp, pathname, description)
>
> ImportError: DLL load failed: The specified module could not be found.
>
>>>>
>
>
>
>
>
> Can anyone point me in the right direction to get the itk python wrapping
> working,
>
>
>
> Many thanks
>
>
>
> Peter
>
>
>
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list