[Insight-users] A Question about using ITK 4.4.2 with Python on OSX 10.8

Sami Koho sami.koho at gmail.com
Wed Oct 2 14:36:01 EDT 2013


Hello,

I am taking my first baby steps with ITK on Mac and have now run into a problem that I could use some help with. I compiled the ITK 4.4.2 from source, which went fine after I found the right settings for CMAKE. Now however I have run into the following problem: loading the ITK library in the Python interpreter works fine, but every time I actually try to do something with ITK - such as loading an image file - I get a following error:

> ile "/Users/sami/Python/ITK/lib/ITK-4.4/Python/itkLazy.py", line 37, in __getattribute__
>     itkBase.LoadModule(module, namespace)
>   File "/Users/sami/Python/ITK/lib/ITK-4.4/Python/itkBase.py", line 42, in LoadModule
>     swig.__dict__.update(this_module.swig.__dict__)
> AttributeError: 'module' object has no attribute 'swig'

The path shown is the installation directory (not the build directory). There seems thus to be a problem with the swig interface. I am using the system swig (installed from mac-ports) as I had some problems with compiling the one that came with ITK. Here are the details:

> 
> SWIG Version 2.0.9
> 
> Compiled with /usr/bin/clang++ [i386-apple-darwin12.2.0]
> 
> Configured options: +pcre

I have set the PYTHONPATH and LD_LIBRARY_PATH as instructed. I am using Python version 2.7.5 that I downloaded from the Python web-page. 

Would someone have an idea, what setting I should change to make this work?

Best,

Sami



More information about the Insight-users mailing list