[Insight-users] ITK in Python

Zachary Pincus zpincus at stanford.edu
Mon Sep 25 15:26:13 EDT 2006


So the general deal here is that the WrapITK Python libs have tricky  
dependencies, and are slow to load fully. So 'import itk' just gives  
you a bunch of proxy objects, that when you try to use them, call  
some code (which can be a bit brittle, as you've seen), to load the  
actual ITK libraries that are needed.

It would appear that somehow, this loading is getting confused about  
where to find the files it needs to load. This information should be  
in (on your system)
/usr/local/itk/Wrapping/WrapITK/Python/itkConfig.py
  Could you send the contents of this file?

In general, the python files you need would be in:
/usr/local/itk/Wrapping/WrapITK/lib
(I think...). Do you have a file VXLNumericsPython.py in that directory?

Zach


On Sep 25, 2006, at 11:55 AM, Erik Anderson wrote:

> Hi all,
>    I have successfully built ITK and WrapITK with (I think) the  
> proper CMake options set.  In a Python shell, I am able to  
> successfully import itk via
>
> import itk
>
> using dir on the module gives me a list of all the wrappings I  
> would expect, however, upon instantiation of a class I get the  
> following type of error:
>
> >>> f = itk.AcosImageFilter
> Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
>  File "/scratch/eranders/env/itk/Wrapping/WrapITK/Python/ 
> itkLazy.py", line 18, in __getattribute__
>    itkBase.LoadModule(module, namespace)
>  File "/scratch/eranders/env/itk/Wrapping/WrapITK/Python/ 
> itkBase.py", line 77, in LoadModule
>    LoadModule(dep, namespace)
>  File "/scratch/eranders/env/itk/Wrapping/WrapITK/Python/ 
> itkBase.py", line 77, in LoadModule
>    LoadModule(dep, namespace)
>  File "/scratch/eranders/env/itk/Wrapping/WrapITK/Python/ 
> itkBase.py", line 85, in LoadModule
>    if not swigModuleName in sys.modules: module = loader.load 
> (swigModuleName)
>  File "/scratch/eranders/env/itk/Wrapping/WrapITK/Python/ 
> itkBase.py", line 191, in load
>    fp, pathname, description = imp.find_module(name)
> ImportError: No module named VXLNumericsPython
>
> My environment is as follows:
>
> Python 2.4 on Suse 10.1
> itk 2.8 built from CVS with WrapITK
>
> Environment variables set:
> LD_LIBRARY_PATH = /usr/local/itk/bin
> PYTHONPATH=/usr/local/itk/Wrapping/WrapITK/Python
>
> Any help would be great.
>
> Thansk,
> Erik Anderson
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users



More information about the Insight-users mailing list