ITK Version and Python Version

We are trying to build a conda version of our application which needs ITK 5.2.1. The build goes off seemingly fine and I get the packages. Inspecting the packages indicates that ITK 5.2.1 is used/required for runtime. But when I do the “conda install dream3d-conda” using a python 3.8 or python 3.9 virtual environment I always get ITK 5.1.2 installed instead of ITK 5.2.1. This causes any of our plugins that depend on ITK to fail to load because the versioning is not correct.

I have been looking around to see if there are any constraints on the python version and the ITK version but the internet is coming up empty so I thought I would ask here. I’ll assume that this is another “user error” on my part but I’m coming up short trying to figure out what is wrong.

This is on macOS 10.15.

Also just built again python 3.10 and now it works correctly? so to sum up using an anaconda virtual environment to build our package;

python 3.8/3.9 uses ITK 5.1.2 instead of the linked 5.2.1
python 3.10 uses both ITK 5.2.1 for build and run.


My guess is: your old Python environments got dirty somehow.

Just today, I had to blow away my ITK build tree and make a fresh build, because my old build was running into a configure error:

CMake Error at C:/Program Files/CMake/share/cmake-3.21/Modules/ExternalData.cmake:837 (message):
  Data file referenced by argument


  corresponds to path


  that does not match regular expression

Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.21/Modules/ExternalData.cmake:708 (_ExternalData_arg_series)
  C:/Program Files/CMake/share/cmake-3.21/Modules/ExternalData.cmake:542 (_ExternalData_arg)
  C:/Program Files/CMake/share/cmake-3.21/Modules/ExternalData.cmake:355 (ExternalData_expand_arguments)
  cmake/ITKModuleTest.cmake:127 (ExternalData_add_test)
  Modules/Segmentation/ConnectedComponents/test/CMakeLists.txt:30 (itk_add_test)

I usually need to start a fresh build of ITK about once every two years, due to accumulation of cruft from continuous development in the same build tree. I have to make a fresh Python install more frequently than that.

Seems you might be correct. I completely blew away my entire anaconda installation, downloaded a fresh conda installer, used the Anaconda GUI app to add channels and create the virtual environments and now all seems fine. Odd. I did some indexing on our server inside the conda folder (conda index .). Not really sure which one finally fixed the issue but it all seems fine now. Not really confidence inspiring for my users.

There is a lot to the conda pinning of dependencies and libraries. You might need to pin the exact ITK library. Perhaps your issue is related?

We this:

I’ll admit that we are very much “new” to conda packaging and are not aware of all the rules to go by. Maybe we are not specifying the ITK version correctly? Odd because our Windows and Linux builds worked correctly, it was just macOS that was getting screwed up. But then again, I may have screwed up my anaconda installation without knowing it.