[ITK-users] Hello World ITK Python

michkapopoff at gmail.com michkapopoff at gmail.com
Wed Jul 22 02:00:24 EDT 2015


Hi

You are stuck at the same error message I am trying to fix but was not able to
for the moment.

what I meant In my previous message is that Python 3 is NOT supported.
(not on Windows; not on Mac, not on Linux).

You will need to use Python 2.

Michka

> On 21 Jul 2015, at 21:41, Siavash Khallaghi <siavashk at ece.ubc.ca> wrote:
> 
> Hello,
> 
> I am trying to get a working example of ITK Hello World in Python. I think I
> have configured and built ITK correctly with the Python wrapper in release
> mode (see  this
> <http://itk-insight-users.2283740.n2.nabble.com/ITK-users-Problem-with-ITK-Python-Wrapper-tt7587592.html>  
> for the details of my build process).
> 
> To set up my environment, I followed the steps in Section 3.7.1 of the 
> ItkSoftwareGuide <http://www.itk.org/ItkSoftwareGuide.pdf>  . I basically
> copied WrapITK.pth from
> /ITK-Build-Directory/Wrapping/Generators/Python/Release to
> /Python34/Lib/site-packages
> 
> My Python code only has the following line: import itkImagePython
> 
> and it terminates with the following errors:
> 
> Traceback (most recent call last):
>  File "C:\Users\siavash\devel\ITK-Python\lib\itkImagePython.py", line 22,
> in swig_import_helper
>    fp, pathname, description = imp.find_module('_itkImagePython',
> [dirname(__file__)])
>  File "C:\Python34\lib\imp.py", line 297, in find_module
>    raise ImportError(_ERR_MSG.format(name), name=name)
> ImportError: No module named '_itkImagePython'
> 
> During handling of the above exception, another exception occurred:
> 
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "C:\Users\siavash\devel\ITK-Python\lib\itkImagePython.py", line 32,
> in <module>
>    _itkImagePython = swig_import_helper()
>  File "C:\Users\siavash\devel\ITK-Python\lib\itkImagePython.py", line 24,
> in swig_import_helper
>    import _itkImagePython
> ImportError: No module named '_itkImagePython'
> 
> Is this because Python 3.x is not supported in Windows yet, or am I doing
> something wrong when I am setting up my environment?
> 
> Siavash
> 
> 
> 
> --
> View this message in context: http://itk-users.7.n7.nabble.com/Hello-World-ITK-Python-tp35928.html
> Sent from the ITK - Users mailing list archive at Nabble.com.
> _____________________________________
> 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://public.kitware.com/mailman/listinfo/insight-users



More information about the Insight-users mailing list