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' #402

Open jingxiweng opened 3 years ago

jingxiweng commented 3 years ago

Hi All, I recently started working on image registration. I was trying to use SimpleElastix. However, I have tried on both Ubuntu and windows 10, but still I can't import it into python successfully. I also did what was on the tutorial (reinstall vc_redist), but it didn't work either. I have seen people previously posted almost same question, but still I can't figure out how I should solve it. Below is the error log. It is my first time to post an issue, sorry for any wrong format.

import SimpleITK Traceback (most recent call last):

File "C:\Users\jwen0002\Anaconda3\lib\site-packages\simpleitk-2.0.0rc2.dev908+g8244e-py3.8-win-amd64.egg\SimpleITK\SimpleITK.py", line 14, in swig_import_helper return importlib.import_module(mname)

File "C:\Users\jwen0002\Anaconda3\lib\importlib__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level)

File "", line 1014, in _gcd_import

File "", line 991, in _find_and_load

File "", line 975, in _find_and_load_unlocked

File "", line 657, in _load_unlocked

File "", line 556, in module_from_spec

File "", line 1101, in create_module

File "", line 219, in _call_with_frames_removed

ImportError: DLL load failed while importing _SimpleITK: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "", line 1, in import SimpleITK

File "C:\Users\jwen0002\Anaconda3\lib\site-packages\simpleitk-2.0.0rc2.dev908+g8244e-py3.8-win-amd64.egg\SimpleITK__init__.py", line 1, in from .SimpleITK import *

File "C:\Users\jwen0002\Anaconda3\lib\site-packages\simpleitk-2.0.0rc2.dev908+g8244e-py3.8-win-amd64.egg\SimpleITK\SimpleITK.py", line 17, in _SimpleITK = swig_import_helper()

File "C:\Users\jwen0002\Anaconda3\lib\site-packages\simpleitk-2.0.0rc2.dev908+g8244e-py3.8-win-amd64.egg\SimpleITK\SimpleITK.py", line 16, in swig_import_helper return importlib.import_module('_SimpleITK')

File "C:\Users\jwen0002\Anaconda3\lib\importlib__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level)

ModuleNotFoundError: No module named '_SimpleITK'

jingxiweng commented 3 years ago

By the way, now I am using a Windows system with anaconda, and there is no python2 installed. Is this error due to the version conflict between python 2 and python 3?

lichy1988 commented 3 years ago

import DicomRTTool Traceback (most recent call last): File "<pyshell#3>", line 1, in import DicomRTTool File "C:\Users\XSS\AppData\Roaming\Python\Python39\site-packages\DicomRTTool__init.py", line 6, in import SimpleITK as sitk File "C:\Users\XSS\AppData\Roaming\Python\Python39\site-packages\SimpleITK\init__.py", line 18, in from SimpleITK.SimpleITK import * File "C:\Users\XSS\AppData\Roaming\Python\Python39\site-packages\SimpleITK\SimpleITK.py", line 13, in from . import _SimpleITK ImportError: DLL load failed while importing _SimpleITK: 找不到指定的模块。

davidweioct commented 3 years ago

Got the same issue: (Windows 10 + Visual studio 2019 + Anaconda3)

ImportError: DLL load failed while importing _SimpleITK: The specified module could not be found.

SimpleElastix used to work for me for the versions 1.5 year and 2 years ago for Linux.

davidweioct commented 3 years ago

It seems to be related to https://github.com/SuperElastix/SimpleElastix/issues/372