2

I am trying to install SimpleElastix/SimpleITK on an Ubuntu computer for either Python2 or 3, whichever we can get to work. Using pip install doesn't work as various methods don't import then (e.g. no "GetDefaultParameterMethod" exists). I tried following the instructions on their website (https://simpleelastix.readthedocs.io/GettingStarted.html#compiling-on-linux), but even though no errors are thrown throughout the process, I am still unable to import. For Python3, the typical "No module" error pops up, but for Python2 I get the following:

>>> import SimpleITK as sitk
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/SimpleITK-1.0.1rc1.dev345+g9dfa8-py2.7-linux-x86_64.egg/SimpleITK/__init__.py", line 1, in <module>
    from .SimpleITK import *
  File "/usr/local/lib/python2.7/dist-packages/SimpleITK-1.0.1rc1.dev345+g9dfa8-py2.7-linux-x86_64.egg/SimpleITK/SimpleITK.py", line 17, in <module>
    _SimpleITK = swig_import_helper()
  File "/usr/local/lib/python2.7/dist-packages/SimpleITK-1.0.1rc1.dev345+g9dfa8-py2.7-linux-x86_64.egg/SimpleITK/SimpleITK.py", line 16, in swig_import_helper
    return importlib.import_module('_SimpleITK')
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named _SimpleITK

Any help would be greatly appreciated :)

cmitch
  • 233
  • 1
  • 10
  • As an update, I wasn't able to get this to work on every computer, but I was able to get this to work on more of them by using the above link for Python2 and https://github.com/rcasero/pysto/wiki/Build-and-install-SimpleElastix-for-python-3.x here for Python3 instead of using Pip. I also found this works best in a virtual environment, although I haven't extensively tested this – cmitch Jul 14 '20 at 20:10

0 Answers0