# Backwards incompatibility with (pip) itk-5.3rc4.post2 and itk-elastix-0.14.1

**URL:** <https://discourse.itk.org/t/backwards-incompatibility-with-pip-itk-5-3rc4-post2-and-itk-elastix-0-14-1/5272>\
**Category:** Uncategorized\
**Created:** [August 17, 2022, 11:31am UTC](https://discourse.itk.org/t/backwards-incompatibility-with-pip-itk-5-3rc4-post2-and-itk-elastix-0-14-1/5272 "2022-08-17T11:31:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![edgar](https://discourse.itk.org/letter_avatar_proxy/v4/letter/e/b487fb/32.png) [@edgar](https://discourse.itk.org/u/edgar)\
**Post date:** [August 17, 2022, 11:31am UTC](https://discourse.itk.org/t/backwards-incompatibility-with-pip-itk-5-3rc4-post2-and-itk-elastix-0-14-1/5272/1 "2022-08-17T11:31:42Z")

</div>

Hi!

I just want to report that if I install:

```auto
pip uninstall -y itk{,-{,elastix,tubetk,strain,core,filtering,io,minimalpathextraction,numerics,registration,segmentation}} && pip install -U pip && pip cache purge && pip install itk{==5.3rc4,-{elastix,strain}}

```

then [this](https://github.com/InsightSoftwareConsortium/ITKElastix/blob/master/examples/ITK_Example11_Transformix_DeformationField.ipynb) works:

```auto
parameter_object = itk.ParameterObject.New()

```

Otherwise, I get this error:

```auto
>>> parameter_object = itk.ParameterObject.New()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/edgar/.local/lib/python3.10/site-packages/itk/support/lazy.py", line 138, in __getattribute__
    base.itk_load_swig_module(module, namespace)
  File "/home/edgar/.local/lib/python3.10/site-packages/itk/support/base.py", line 132, in itk_load_swig_module
    l_module = loader.load(swig_module_name)
  File "/home/edgar/.local/lib/python3.10/site-packages/itk/support/base.py", line 291, in load
    l_spec.loader.exec_module(l_module) # pytype: disable=attribute-error
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/edgar/.local/lib/python3.10/site-packages/itk/support/../ElastixPython.py", line 13, in <module>
    from . import _ElastixPython
AttributeError: PyCapsule_Import "_ITKCommonPython._C_API" is not valid

```

(with `itk-5.3rc4.post2`)

Cheers!

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [August 17, 2022, 1:49pm UTC](https://discourse.itk.org/t/backwards-incompatibility-with-pip-itk-5-3rc4-post2-and-itk-elastix-0-14-1/5272/2 "2022-08-17T13:49:17Z")

</div>

Thanks for reporting, but it looks like a duplicate of:

> <https://github.com/InsightSoftwareConsortium/ITK/issues/3528>
>
> \<!-- The text within this markup is a comment, and is intended to provide
> guide…lines to open an issue for the ITK repository. This text will not
> be part of the issue. --\>
> 
> 
> \<!-- Before submitting an issue, please check that your issue has not been
> already filed. --\>
> 
> \### Description
> 
> 
> 
> Python module loading change introduced in \[https://github.com/InsightSoftwareConsortium/ITK/commit/835dc01388d22c4b4c9a46b01dbdfe394ec23511\](https://github.com/InsightSoftwareConsortium/ITK/commit/835dc01388d22c4b4c9a46b01dbdfe394ec23511) appears to break backwards compatibility with ITK Python external modules targeting an older version of ITK.
> 
> \### Steps to Reproduce
> 
> \<!--
> 1. \[First Step\]
> 2. \[Second Step\]
> 3. \[and so on...\]
> 
> Provide a minimal, complete, compilable, and verifiable example (commonly
> abbreviated as MWE, Minimal Working Example, or sometimes referred to as SSEE,
> Short, Self Contained, Correct (Compilable) Example, SSCCE) or code snippet,
> either through a GitHub gist (https://gist.github.com/) or providing your own
> files (including your source code, \`CMakeLists.txt\` file if applicable, and your
> data) reproducing the issue or showing an incorrect result. --\>
> 
> 1. Install external module package. Tested with \`itk-meshtopolydata\`, \`itk-elastix\`, \`itk-ultrasound\`
> 2. In a Python console try to force load modules with verbosity on
> \`\`\`
> \> import itk
> \> itk.auto\_progress(2)
> \> itk.force\_load()
> \`\`\`
> 
> \### Expected behavior
> 
> 
> 
> Modules load without error. With \`itk-meshtopolydata==0.8.4\` which is built against the ITK Python \`v5.3rc04.post2\` tag including the relevant commit:
> \`\`\`
> \>\>\> itk.force\_load()
> Loading ITKPyBase... done
> Loading ITKCommon... done
> ...
> Loading ITKIOTransformMatlab... done
> done
> Loading MeshToPolyData... done
> Loading ITKDeconvolution... done
> Loading ITKWatersheds... done
> ...
> Loading ITKIOSpatialObjects... done
> Loading ITKVTK... done
> \`\`\`
> 
> \### Actual behavior
> 
> 
> 
> Error on load. With \`itk-meshtopolydata==0.8.3\` which is built against the \`v5.3rc04.post1\` ITK Python tag not including the relevant commit:
> 
> \`\`\`none
> \>\>\> itk.force\_load()
> ...
> Loading ITKIOTransformMatlab... done
> done
> Loading MeshToPolyData... Traceback (most recent call last):
> File "\<stdin\>", line 1, in \<module\>
> File "C:\\Users\\tom.birdsong\\Anaconda3\\envs\\venv-itk\\lib\\site-packages\\itk\\support\\init\_helpers.py", line 116, in force\_load
> getattr(itk, k)
> File "C:\\Users\\tom.birdsong\\Anaconda3\\envs\\venv-itk\\lib\\site-packages\\itk\\support\\lazy.py", line 138, in \_\_getattribute\_\_
> base.itk\_load\_swig\_module(module, namespace)
> File "C:\\Users\\tom.birdsong\\Anaconda3\\envs\\venv-itk\\lib\\site-packages\\itk\\support\\base.py", line 132, in itk\_load\_swig\_module
> l\_module = loader.load(swig\_module\_name)
> File "C:\\Users\\tom.birdsong\\Anaconda3\\envs\\venv-itk\\lib\\site-packages\\itk\\support\\base.py", line 291, in load
> l\_spec.loader.exec\_module(l\_module) # pytype: disable=attribute-error
> File "\<frozen importlib.\_bootstrap\_external\>", line 783, in exec\_module
> File "\<frozen importlib.\_bootstrap\>", line 219, in \_call\_with\_frames\_removed
> File "C:\\Users\\tom.birdsong\\Anaconda3\\envs\\venv-itk\\lib\\site-packages\\itk\\support\\..\\MeshToPolyDataPython.py", line 13, in \<module\>
> from . import \_MeshToPolyDataPython
> AttributeError: PyCapsule\_Import "\_ITKCommonPython.\_C\_API" is not valid
> \`\`\`
> 
> \### Reproducibility
> 
> 
> 
> 100%
> 
> \### Versions
> 
> \<!-- If a tagged version, you can get this information by inspecting the
> \`ITK\_VERSION\_MAJOR\` \`ITK\_VERSION\_MINOR\` and \`ITK\_VERSION\_PATCH\` variable
> values in the \`ITKConfig.cmake\` file.
> 
> If the commit number is required, run \`$ git rev-parse --short HEAD\`. --\>
> 
> ITK version: \`itk==v5.3rc04.post2\`
> 
> \### Environment
> 
> \<!-- Which your OS, CMake, and compiler versions are, or your Python and
> installed package versions are. --\>
> 
> Windows 10
> Python 3.8.5
> 
> Incompatible: \`itk-meshtopolydata==v0.8.3\`
> Incompatible: \`itk-ultrasound==v0.5.6\`
> Incompatible: \`itk-elastix==0.14.1\`
> 
> \### Additional Information
> 
> \<!-- Any additional information, configuration or data that might be necessary
> to reproduce the issue. --\>
> 
> My understanding is that \[https://github.com/InsightSoftwareConsortium/ITK/commit/835dc01388d22c4b4c9a46b01dbdfe394ec23511\](https://github.com/InsightSoftwareConsortium/ITK/commit/835dc01388d22c4b4c9a46b01dbdfe394ec23511) is an important fix. This behavior may be determined to be an acceptable tradeoff with a heightened focus on getting remote modules updated for \`v5.3rc04.post2\` or later.
> 
> cc @thewtex @jcfr
> 
> \<!-- \*\*Note\*\*: Use issues for their purpose; issues are not for code help. Need
> help? Ask your question at ITK discourse (https://discourse.itk.org/). --\>

---

<div class="post-metadata">

**Author:** ![edgar](https://discourse.itk.org/letter_avatar_proxy/v4/letter/e/b487fb/32.png) [@edgar](https://discourse.itk.org/u/edgar)\
**Post date:** [August 18, 2022, 3:25pm UTC](https://discourse.itk.org/t/backwards-incompatibility-with-pip-itk-5-3rc4-post2-and-itk-elastix-0-14-1/5272/3 "2022-08-18T15:25:24Z")

</div>

Yes, indeed. I’m glad that it is being addressed 🙂 . (I will try to remember to check the repository next time).
