SimpleITK python installation in windows container

Hi all,
I am trying to use simpleITK inside the docker windows container. The container is built without any error. But when I run the container, I am getting the following error.

Traceback (most recent call last):

  • File “c:\helloworld.py”, line 1, in *
  • import SimpleITK as sitk*
  • File “C:\Python\lib\site-packages\SimpleITK_init_.py”, line 18, in *
  • from SimpleITK.SimpleITK import **
  • File “C:\Python\lib\site-packages\SimpleITK\SimpleITK.py”, line 13, in *
  • from . import _SimpleITK*
    ImportError: DLL load failed while importing _SimpleITK: The specified module could not be found.

Here is my Dockerfile

FROM python:3.9-windowsservercore
COPY helloworld.py c:/helloworld.py
COPY requirements.txt c:/requirements.txt
RUN python -m pip install -r c:/requirements.txt
CMD [ “python” ,“c:/helloworld.py”]

Here is the helloworld.py

import SimpleITK as sitk
print(“Hello World !!!”)
img = sitk.ReadImage(’./input/sample.mha’)
print(img.GetDimension())
print(img.GetSize())