Two ITK packages in Slicer

When I try to register two volumes using our ANTsPy extension, I get this error on Linux. Things workout perfectly fine on Windows and Mac:

Switch to module:  "ANTsRegistration"
WARNING: In /project/itksource/Modules/Core/Common/src/itkObjectFactoryBase.cxx, line 543
Possible incompatible factory load:
Running itk version :
itk version 5.4.3
Loaded factory version:
itk version 5.4.4
Loading factory:
/home/maga/Downloads/Slicer-5.10.0-linux-amd64/bin/../lib/Slicer-5.10/ITKFactories/libMRMLIDIOPlugin.so

But when I look at the packages ANTsRegistration is loading, I am not seeing an ITK-5.4.3 being brought in:

[DEBUG][Qt] 10.11.2025 15:23:05 [] (unknown:0) - Switch to module:  "ANTsRegistration"
[INFO][Stream] 10.11.2025 15:23:06 [] (unknown:0) - Collecting antspyx
[INFO][Stream] 10.11.2025 15:23:06 [] (unknown:0) -   Using cached antspyx-0.6.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (7.1 kB)
[INFO][Stream] 10.11.2025 15:23:06 [] (unknown:0) - Collecting pandas (from antspyx)
[INFO][Stream] 10.11.2025 15:23:06 [] (unknown:0) -   Using cached pandas-2.3.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.metadata (91 kB)
[INFO][Stream] 10.11.2025 15:23:06 [] (unknown:0) - Collecting pyyaml (from antspyx)
[INFO][Stream] 10.11.2025 15:23:06 [] (unknown:0) -   Using cached pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (2.4 kB)
[INFO][Stream] 10.11.2025 15:23:06 [] (unknown:0) - Requirement already satisfied: numpy in ./lib/Python/lib/python3.12/site-packages (from antspyx) (2.0.2)
[INFO][Stream] 10.11.2025 15:23:06 [] (unknown:0) - Collecting statsmodels (from antspyx)
[INFO][Stream] 10.11.2025 15:23:06 [] (unknown:0) -   Using cached statsmodels-0.14.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (9.5 kB)
[INFO][Stream] 10.11.2025 15:23:06 [] (unknown:0) - Collecting webcolors (from antspyx)
[INFO][Stream] 10.11.2025 15:23:06 [] (unknown:0) -   Using cached webcolors-25.10.0-py3-none-any.whl.metadata (2.2 kB)
[INFO][Stream] 10.11.2025 15:23:06 [] (unknown:0) - Collecting matplotlib (from antspyx)
[INFO][Stream] 10.11.2025 15:23:06 [] (unknown:0) -   Using cached matplotlib-3.10.7-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (11 kB)
[INFO][Stream] 10.11.2025 15:23:06 [] (unknown:0) - Requirement already satisfied: Pillow in ./lib/Python/lib/python3.12/site-packages (from antspyx) (11.2.1)
[INFO][Stream] 10.11.2025 15:23:06 [] (unknown:0) - Requirement already satisfied: requests in ./lib/Python/lib/python3.12/site-packages (from antspyx) (2.32.3)
[INFO][Stream] 10.11.2025 15:23:06 [] (unknown:0) - Collecting scikit-learn (from antspyx)
[INFO][Stream] 10.11.2025 15:23:06 [] (unknown:0) -   Using cached scikit_learn-1.7.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (11 kB)
[INFO][Stream] 10.11.2025 15:23:06 [] (unknown:0) - Requirement already satisfied: scipy<1.16 in ./lib/Python/lib/python3.12/site-packages (from antspyx) (1.13.1)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Collecting contourpy>=1.0.1 (from matplotlib->antspyx)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) -   Using cached contourpy-1.3.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.metadata (5.5 kB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Collecting cycler>=0.10 (from matplotlib->antspyx)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) -   Using cached cycler-0.12.1-py3-none-any.whl.metadata (3.8 kB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Collecting fonttools>=4.22.0 (from matplotlib->antspyx)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) -   Using cached fonttools-4.60.1-cp312-cp312-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl.metadata (112 kB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Collecting kiwisolver>=1.3.1 (from matplotlib->antspyx)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) -   Using cached kiwisolver-1.4.9-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (6.3 kB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Requirement already satisfied: packaging>=20.0 in ./lib/Python/lib/python3.12/site-packages (from matplotlib->antspyx) (25.0)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Requirement already satisfied: pyparsing>=3 in ./lib/Python/lib/python3.12/site-packages (from matplotlib->antspyx) (3.2.3)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Requirement already satisfied: python-dateutil>=2.7 in ./lib/Python/lib/python3.12/site-packages (from matplotlib->antspyx) (2.9.0.post0)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Requirement already satisfied: six>=1.5 in ./lib/Python/lib/python3.12/site-packages (from python-dateutil>=2.7->matplotlib->antspyx) (1.17.0)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Collecting pytz>=2020.1 (from pandas->antspyx)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) -   Using cached pytz-2025.2-py2.py3-none-any.whl.metadata (22 kB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Collecting tzdata>=2022.7 (from pandas->antspyx)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) -   Using cached tzdata-2025.2-py2.py3-none-any.whl.metadata (1.4 kB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Requirement already satisfied: charset-normalizer<4,>=2 in ./lib/Python/lib/python3.12/site-packages (from requests->antspyx) (3.4.2)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Requirement already satisfied: idna<4,>=2.5 in ./lib/Python/lib/python3.12/site-packages (from requests->antspyx) (3.10)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Requirement already satisfied: urllib3<3,>=1.21.1 in ./lib/Python/lib/python3.12/site-packages (from requests->antspyx) (2.4.0)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Requirement already satisfied: certifi>=2017.4.17 in ./lib/Python/lib/python3.12/site-packages (from requests->antspyx) (2025.4.26)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Collecting joblib>=1.2.0 (from scikit-learn->antspyx)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) -   Using cached joblib-1.5.2-py3-none-any.whl.metadata (5.6 kB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Collecting threadpoolctl>=3.1.0 (from scikit-learn->antspyx)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) -   Using cached threadpoolctl-3.6.0-py3-none-any.whl.metadata (13 kB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Collecting patsy>=0.5.6 (from statsmodels->antspyx)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) -   Using cached patsy-1.0.2-py2.py3-none-any.whl.metadata (3.6 kB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Using cached antspyx-0.6.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (22.4 MB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Using cached matplotlib-3.10.7-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (8.7 MB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Using cached contourpy-1.3.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (362 kB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Using cached cycler-0.12.1-py3-none-any.whl (8.3 kB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Using cached fonttools-4.60.1-cp312-cp312-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl (4.9 MB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Using cached kiwisolver-1.4.9-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.5 MB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Using cached pandas-2.3.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (12.4 MB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Using cached pytz-2025.2-py2.py3-none-any.whl (509 kB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Using cached tzdata-2025.2-py2.py3-none-any.whl (347 kB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Using cached pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (807 kB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Using cached scikit_learn-1.7.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (9.5 MB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Using cached joblib-1.5.2-py3-none-any.whl (308 kB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Using cached threadpoolctl-3.6.0-py3-none-any.whl (18 kB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Using cached statsmodels-0.14.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (10.4 MB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Using cached patsy-1.0.2-py2.py3-none-any.whl (233 kB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Using cached webcolors-25.10.0-py3-none-any.whl (14 kB)
[INFO][Stream] 10.11.2025 15:23:07 [] (unknown:0) - Installing collected packages: pytz, webcolors, tzdata, threadpoolctl, pyyaml, patsy, kiwisolver, joblib, fonttools, cycler, contourpy, scikit-learn, pandas, matplotlib, statsmodels, antspyx
[INFO][Stream] 10.11.2025 15:23:21 [] (unknown:0) -
[INFO][Stream] 10.11.2025 15:23:21 [] (unknown:0) - Successfully installed antspyx-0.6.1 contourpy-1.3.3 cycler-0.12.1 fonttools-4.60.1 joblib-1.5.2 kiwisolver-1.4.9 matplotlib-3.10.7 pandas-2.3.3 patsy-1.0.2 pytz-2025.2 pyyaml-6.0.3 scikit-learn-1.7.2 statsmodels-0.14.5 threadpoolctl-3.6.0 tzdata-2025.2 webcolors-25.10.0

When I try to run pip_uninstall("itk==5.4.3") I get skipping, not installed message. when I check for itk version I get 5.4.4

>>> import itk
>>> itk.__version__
'5.4.4'

It is not clear to me or @dzenanz where this itk-5.4.3 is coming from. Again this is specific to the Linux and is reproducible all recent previews, and today’s stable. Any suggestion is much appreciated.

It appears that AntsPy does not use ITK’s Python package but instead builds ITK C++ from source and uses that along with wrapping it using a package called nanobind.

I observe similar warnings about possible incompatible factory load when I connect an OpenIGTLink connection using PlusToolkit’s PlusServer that uses a slightly different ITK version than the one used by Slicer core and corresponding SlicerOpenIGTLink extension. I observe the warning, but generally don’t face any issues because the versions are similar enough.

Here is the C++ ITK build that uses ITK 5.4.3.

Thanks @jamesobutler

I will try to build a custom wheel using 5.4.4.post1, but don’t know how to get that ITK tag.

Do you know where I can find that information?

Found it: f98d5fac5e1d5ef694f3010f12bbbc2c792994c6

Looks like the custom antspyx wheel with itk-5.4.4 seems to solve the crash. I will make changes in SlicerANTsPy to use this custom wheel on Linux. Thanks @jamesobutler