SuperElastix / SimpleElastix

Multi-lingual medical image registration library
http://simpleelastix.github.io
Apache License 2.0
509 stars 149 forks source link

`No module named '_SimpleITK'` after installing SimpleElastix #424

Open fleurgaudfernau opened 3 years ago

fleurgaudfernau commented 3 years ago

Dear all,

This issue seems to be pretty common, but so far I couldn't find a solution that worked for me...

I've tried to install SimpleElastix on Linux as specified in here: https://simpleelastix.readthedocs.io/GettingStarted.html I activated my python environment then installed SimpleElastix using python Packaging/setup.py install

After installation, when calling sitk.ElastixImageFilter(), the following error appeared: Module 'SimpleITK' has no attribute 'ElastixImageFilter'. I read in other issues that this might be due to several versions of SimpleITK coexisting on my computer, so I uninstalled SimpleITK and reinstalled SimpleElastix to ensure there was only one version of SimpleITK on my machine.

Now, when I try to import SimpleITK, python doesn't seem to find it: No module named '_SimpleITK'

I use python 3.6.

Thanks in advance!

numancelik34 commented 2 years ago

is there any solution to this issue? Thanks

Dauriel commented 2 years ago

Hello both! I had the same problem and found where the issue was for me:

Instead of calling python Packaging/setup.py install , I used the full path to the python environment I wanted it to be installed in, in my case miniconda3/envs/myenv/bin/python Packaging/setup.py install .

Hope it works for you too!

annafoster318 commented 2 years ago

I am also having this issue and would love for someone to take another look at this. Thanks!

Dauriel commented 2 years ago

I am also having this issue and would love for someone to take another look at this. Thanks!

Hi @annafoster318 , I did manage to make it work couple months ago. Did you try what I suggested?