ITKElastix icon indicating copy to clipboard operation
ITKElastix copied to clipboard

Python wrappings don't work in RelWithDebInfo mode

Open dzenanz opened this issue 2 years ago • 0 comments

import itk
parameter_object = itk.ParameterObject.New()

produces:

Traceback (most recent call last):
  File "C:\Dev\ITK-py\Wrapping\Generators\Python\itk\support\lazy.py", line 137, in __getattribute__
    base.itk_load_swig_module(module, namespace)
  File "C:\Dev\ITK-py\Wrapping\Generators\Python\itk\support\base.py", line 110, in itk_load_swig_module
    l_module = loader.load(swig_module_name)
  File "C:\Dev\ITK-py\Wrapping\Generators\Python\itk\support\base.py", line 259, in load
    l_spec.loader.exec_module(l_module)  # pytype: disable=attribute-error
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Dev\ITK-py\Wrapping\Generators\Python\itk\support\..\ElastixPython.py", line 13, in <module>
    from . import _ElastixPython
ImportError: cannot import name '_
' from 'itk' (C:\Dev\ITK-py\Wrapping\Generators\Python\itk\__init__.py)
python-BaseException

Process finished with exit code -1

_ElastixPython.pyd exists on disk.

If Release mode is used, everything works as expected. If this is ever fixed, a humane warning in #142 should be removed.

dzenanz avatar Feb 21 '22 21:02 dzenanz