[ITK-users] Hello World ITK Python

Siavash Khallaghi siavashk at ece.ubc.ca
Tue Jul 21 15:41:51 EDT 2015


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.


More information about the Insight-users mailing list