Build error on MacOSX, When install simpleITK, ModuleNotFoundError: No module named 'skbuild' occur

MacOS 11.5.2,
Qt 5.15.2,
Xcode 12.5.1,
cmake 3.20.5

SimpleITK: install step failed with exit code ‘1’.

Best match: SimpleITK 2.1.0
Processing SimpleITK-2.1.0.tar.gz
Writing /tmp/easy_install-e5igwpuy/SimpleITK-2.1.0/setup.cfg
Running SimpleITK-2.1.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-e5igwpuy/SimpleITK-2.1.0/egg-dist-tmp-uwx0nksb

zip_safe flag not set; analyzing archive contents...
SimpleITK.__pycache__._SimpleITK.cpython-36: module references __file__
Traceback (most recent call last):
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/sandbox.py", line 152, in save_modules
    yield saved
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/sandbox.py", line 193, in setup_context
    yield
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/sandbox.py", line 254, in run_setup
    _execfile(setup_script, ns)
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/sandbox.py", line 43, in _execfile
    exec(code, globals, locals)
  File "/tmp/easy_install-e5igwpuy/SimpleITK-2.1.0/setup.py", line 3, in <module>
    
ModuleNotFoundError: No module named 'skbuild'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "setup.py", line 85, in <module>
    cmdclass={'build_ext':build_ext}
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/opt/s/python-install/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/opt/s/python-install/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/opt/s/python-install/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/command/install.py", line 67, in run
    self.do_egg_install()
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/command/install.py", line 117, in do_egg_install
    cmd.run(show_deprecation=False)
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 408, in run
    self.easy_install(spec, not self.no_deps)
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 650, in easy_install
    return self.install_item(None, spec, tmpdir, deps, True)
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 697, in install_item
    self.process_distribution(spec, dist, deps)
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 745, in process_distribution
    [requirement], self.local_index, self.easy_install
  File "/opt/s/python-install/lib/python3.6/site-packages/pkg_resources/__init__.py", line 768, in resolve
    replace_conflicting=replace_conflicting
  File "/opt/s/python-install/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1051, in best_match
    return self.obtain(req, installer)
  File "/opt/s/python-install/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1063, in obtain
    return installer(requirement)
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 669, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 695, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 890, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1162, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1146, in run_setup
    run_setup(setup_script, args)
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/sandbox.py", line 257, in run_setup
    raise
  File "/opt/s/python-install/lib/python3.6/contextlib.py", line 99, in __exit__
    self.gen.throw(type, value, traceback)
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/sandbox.py", line 193, in setup_context
    yield
  File "/opt/s/python-install/lib/python3.6/contextlib.py", line 99, in __exit__
    self.gen.throw(type, value, traceback)
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/sandbox.py", line 164, in save_modules
    saved_exc.resume()
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/sandbox.py", line 139, in resume
    raise exc.with_traceback(self._tb)
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/sandbox.py", line 152, in save_modules
    yield saved
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/sandbox.py", line 193, in setup_context
    yield
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/sandbox.py", line 254, in run_setup
    _execfile(setup_script, ns)
  File "/opt/s/python-install/lib/python3.6/site-packages/setuptools/sandbox.py", line 43, in _execfile
    exec(code, globals, locals)
  File "/tmp/easy_install-e5igwpuy/SimpleITK-2.1.0/setup.py", line 3, in <module>
    
ModuleNotFoundError: No module named 'skbuild'
CMake Error at 
  ../Slicer/CMake/ExternalProjectForNonCMakeProject.cmake:104 (message):
  SimpleITK: install step failed with exit code '1'.

  Outputs also captured in /opt/s/SimpleITK_install_step_output.txt and
  /opt/s/SimpleITK_install_step_error.txt.

  Setting env.  variable EP_EXECUTE_DISABLE_CAPTURE_OUTPUTS to 1 allows to
  disable file capture.

Call Stack (most recent call first):
  /opt/s/SimpleITK_install_step.cmake:3 (ExternalProject_Execute)

It seems that you have run into this issue (SimeITK finds system Python instead of Slicer’s):

Please check in the issue tracker if there is an easy workaround.

1 Like

Hi, thank you for the information. I can see that I met the same problem that SimpleITK just find the wrong python path( which is my system path).