NHPatterson / napari-wsireg

Whole slide image registration through wsireg in napari.
BSD 3-Clause "New" or "Revised" License
11 stars 3 forks source link

DLL load failed while importing _ITKCommonPython: The specified module could not be found. #6

Closed ved-sharma closed 2 years ago

ved-sharma commented 2 years ago

Hello,

I tried following commands to install napari-wsireg in a separate environment on my Windows 10 machine:

conda create -n nap-wreg python=3.9 conda activate nap-wreg pip install wsireg pip install napari-wsireg pip install "napari[all]"

Everything went fine, until I opened Napari and clicked on Plugins > napari-wsireg. I got a bunch of errors and I am not sure if it's a library issue or something else. Could you please help? Here is the full traceback in case you want to see:


ImportError Traceback (most recent call last) File ~.conda\envs\nap-wreg\lib\site-packages\npe2_command_registry.py:33, in CommandHandler.resolve(self=CommandHandler(id='napari-wsireg.make_qwidget', ...python_name='napari_wsireg._widget:WsiReg2DMain')) 32 try: ---> 33 self.function = utils.import_python_name(self.python_name) self.function = None self.python_name = 'napari_wsireg._widget:WsiReg2DMain' self = CommandHandler(id='napari-wsireg.make_qwidget', function=None, python_name='napari_wsireg._widget:WsiReg2DMain') utils = <module 'npe2.manifest.utils' from 'C:\Users\test\.conda\envs\nap-wreg\lib\site-packages\npe2\manifest\utils.py'> 34 except Exception as e:

File ~.conda\envs\nap-wreg\lib\site-packages\npe2\manifest\utils.py:231, in import_python_name(python_name='napari_wsireg._widget:WsiReg2DMain') 229 module_name, funcname = match.groups() # type: ignore [union-attr] --> 231 mod = import_module(module_name) module_name = 'napari_wsireg._widget' 232 return getattr(mod, funcname)

File ~.conda\envs\nap-wreg\lib\importlib__init__.py:127, in import_module(name='napari_wsireg._widget', package=None) 126 level += 1 --> 127 return _bootstrap._gcd_import(name[level:], package, level) level = 0 name = 'napari_wsireg._widget' name[level:] = 'napari_wsireg._widget' package = None _bootstrap = <module 'importlib._bootstrap' (frozen)>

File :1030, in _gcd_import(name='napari_wsireg._widget', package=None, level=0)

File :1007, in _find_and_load(name='napari_wsireg.widget', import=)

File :986, in _find_and_load_unlocked(name='napari_wsireg.widget', import=)

File :680, in _load_unlocked(spec=ModuleSpec(name='napari_wsireg._widget', loader=...\lib\site-packages\napari_wsireg\_widget.py'))

File :850, in exec_module(self=<_frozen_importlib_external.SourceFileLoader object>, module=<module 'napari_wsireg._widget' from 'C:\Users...\lib\site-packages\napari_wsireg\_widget.py'>)

File :228, in _call_with_frames_removed(f=, *args=(<code object at 0x000001BD5FFDAC90, fil...\site-packages\napari_wsireg_widget.py", line 1>, {'Any': typing.Any, 'Dict': typing.Dict, 'Image': <class 'napari.layers.image.image.Image'>, 'Labels': <class 'napari.layers.labels.labels.Labels'>, 'List': typing.List, 'Optional': typing.Optional, 'Path': <class 'pathlib.Path'>, 'Points': <class 'napari.layers.points.points.Points'>, 'QErrorMessage': <class 'PyQt5.QtWidgets.QErrorMessage'>, 'QEvent': <class 'PyQt5.QtCore.QEvent'>, ...}), **kwds={})

File ~.conda\envs\nap-wreg\lib\site-packages\napari_wsireg_widget.py:24, in 14 from qtpy.QtWidgets import ( 15 QErrorMessage, 16 QMessageBox, (...) 22 QScrollArea, 23 ) ---> 24 from wsireg.parameter_maps.preprocessing import ImagePreproParams 25 from wsireg.parameter_maps.reg_model import RegModel

File ~.conda\envs\nap-wreg\lib\site-packages\wsireg__init__.py:2, in 1 # flake8: noqa ----> 2 from .wsireg2d import WsiReg2D 4 """wsireg."""

File ~.conda\envs\nap-wreg\lib\site-packages\wsireg\wsireg2d.py:15, in 14 from wsireg.parameter_maps.reg_model import RegModel ---> 15 from wsireg.reg_images import MergeRegImage 16 from wsireg.reg_images.reg_image import RegImage

File ~.conda\envs\nap-wreg\lib\site-packages\wsireg\reg_images__init__.py:1, in ----> 1 from .np_reg_image import NumpyRegImage # noqa: F401 2 from .sitk_reg_image import SitkRegImage # noqa: F401

File ~.conda\envs\nap-wreg\lib\site-packages\wsireg\reg_images\np_reg_image.py:6, in 4 import SimpleITK as sitk ----> 6 from wsireg.reg_images.reg_image import RegImage 7 from wsireg.utils.im_utils import ( 8 ensure_dask_array, 9 guess_rgb, 10 preprocess_dask_array, 11 )

File ~.conda\envs\nap-wreg\lib\site-packages\wsireg\reg_images\reg_image.py:30, in 21 from wsireg.utils.tform_utils import ( 22 gen_aff_tform_flip, 23 gen_rig_to_original, (...) 26 prepare_wsireg_transform_data, 27 ) ---> 30 class RegImage(ABC): ABC = <class 'abc.ABC'> 31 """Base class for registration images"""

File ~.conda\envs\nap-wreg\lib\site-packages\wsireg\reg_images\reg_image.py:37, in RegImage() 36 _dask_image: da.Array ---> 37 _reg_image: Union[sitk.Image, itk.Image] sitk.Image, itk.Image = (<class 'SimpleITK.SimpleITK.Image'>, 'not loaded') sitk = <module 'SimpleITK' from 'C:\Users\test\.conda\envs\nap-wreg\lib\site-packages\SimpleITK\init.py'> itk.Image = 'not loaded' itk = <module 'itk' from 'C:\Users\test\.conda\envs\nap-wreg\lib\site-packages\itk\init.py'> 38 _mask: Optional[Union[sitk.Image, itk.Image]] = None

File ~.conda\envs\nap-wreg\lib\site-packages\itk\support\lazy.py:138, in LazyITKModule.getattribute(self=<module 'itk' from 'C:\Users\test\.conda...\nap-wreg\lib\site-packages\itk\init.py'>, attr='Image') 137 namespace = {} --> 138 base.itk_load_swig_module(module, namespace) module = 'ITKCommon' namespace = {'swig': {'_swig_python_version_info': sys.version_info(major=3, minor=9, micro=12, releaselevel='final', serial=0), '_ITKPyBasePython': <module 'itk._ITKPyBasePython' from 'C:\Users\test\.conda\envs\nap-wreg\lib\site-packages\itk\_ITKPyBasePython.pyd'>, '_swig_new_instance_method': , '_swig_new_static_method': , '_swig_repr': <function _swig_repr at 0x000001BD61DE5DC0>, '_swig_setattr_nondynamic_instance_variable': <function _swig_setattr_nondynamic_instance_variable at 0x000001BD61DE5E50>, '_swig_setattr_nondynamic_class_variable': <function _swig_setattr_nondynamic_class_variable at 0x000001BD61DE5F70>, '_swig_add_metaclass': <function _swig_add_metaclass at 0x000001BD61E99040>, '_SwigNonDynamicMeta': <class 'itk.ITKPyBasePython._SwigNonDynamicMeta'>, 'swig': {'_swig_python_version_info': sys.version_info(major=3, minor=9, micro=12, releaselevel='final', serial=0), '_ITKPyBasePython': <module 'itk._ITKPyBasePython' from 'C:\Users\test\.conda\envs\nap-wreg\lib\site-packages\itk\_ITKPyBasePython.pyd'>, '_swig_new_instance_method': , '_swig_new_static_method': , '_swig_repr': <function _swig_repr at 0x000001BD61DE5DC0>, '_swig_setattr_nondynamic_instance_variable': <function _swig_setattr_nondynamic_instance_variable at 0x000001BD61DE5E50>, '_swig_setattr_nondynamic_class_variable': <function _swig_setattr_nondynamic_class_variable at 0x000001BD61DE5F70>, '_swig_add_metaclass': <function _swig_add_metaclass at 0x000001BD61E99040>, '_SwigNonDynamicMeta': <class 'itk.ITKPyBasePython._SwigNonDynamicMeta'>, 'swig': {...}, 'collections': <module 'collections' from 'C:\Users\test\.conda\envs\nap-wreg\lib\collections\init.py'>, 'SwigPyIterator': <class 'itk.pyBasePython.SwigPyIterator'>, 'ios_base': <class 'itk.pyBasePython.ios_base'>, 'cvar': , 'ios_base_sync_with_stdio': , 'ios_base_xalloc': , 'ios': <class 'itk.pyBasePython.ios'>, 'ostream': <class 'itk.pyBasePython.ostream'>, 'cin': <Swig Object of type 'std::istream ' at 0x000001BD61ECD0C0>, 'cout': <itk.pyBasePython.ostream; proxy of <Swig Object of type 'std::ostream ' at 0x000001BD61ECD0F0> >, 'cerr': <itk.pyBasePython.ostream; proxy of <Swig Object of type 'std::ostream ' at 0x000001BD61ECD180> >, 'clog': <itk.pyBasePython.ostream; proxy of <Swig Object of type 'std::ostream ' at 0x000001BD61ECD210> >, 'istream': <class 'itk.pyBasePython.istream'>, 'iostream': <class 'itk.pyBasePython.iostream'>, 'endl_cb_ptr': <Swig Object of type 'std::basic_ostream< char,std::char_traits< char > > &()(std::basic_ostream< char,std::char_traits< char > > &)' at 0x000001BD61E00210>, 'endl': , 'ends_cb_ptr': <Swig Object of type 'std::basic_ostream< char,std::char_traits< char > > &()(std::basic_ostream< char,std::char_traits< char > > &)' at 0x000001BD61E00240>, 'ends': , 'flush_cb_ptr': <Swig Object of type 'std::basic_ostream< char,std::char_traits< char > > &()(std::basic_ostream< char,std::char_traits< char > > &)' at 0x000001BD61E128A0>, 'flush': , 'str': <class 'str'>, 'mapULD': <class 'itk.pyBasePython.mapULD'>, 'mapBB': <class 'itk.pyBasePython.mapBB'>, 'mapII': <class 'itk.pyBasePython.mapII'>, 'mapUCUC': <class 'itk.pyBasePython.mapUCUC'>, 'mapUIUI': <class 'itk.pyBasePython.mapUIUI'>, 'mapUSUS': <class 'itk.pyBasePython.mapUSUS'>, 'mapULUL': <class 'itk.pyBasePython.mapULUL'>, 'mapSCSC': <class 'itk.pyBasePython.mapSCSC'>, 'mapSSSS': <class 'itk.pyBasePython.mapSSSS'>, 'mapSLSL': <class 'itk.pyBasePython.mapSLSL'>, 'mapFF': <class 'itk.pyBasePython.mapFF'>, 'mapDD': <class 'itk.pyBasePython.mapDD'>, 'pairI': <class 'itk.pyBasePython.pairI'>, 'pairUI': <class 'itk.pyBasePython.pairUI'>, 'vectorB': <class 'itk.pyBasePython.vectorB'>, 'vectorvectorB': <class 'itk.pyBasePython.vectorvectorB'>, 'vectorI': <class 'itk.pyBasePython.vectorI'>, 'vectorvectorI': <class 'itk.pyBasePython.vectorvectorI'>, 'vectorUC': <class 'itk.pyBasePython.vectorUC'>, 'vectorvectorUC': <class 'itk.pyBasePython.vectorvectorUC'>, 'vectorUS': <class 'itk.pyBasePython.vectorUS'>, 'vectorvectorUS': <class 'itk.pyBasePython.vectorvectorUS'>, 'vectorUI': <class 'itk.pyBasePython.vectorUI'>, 'vectorvectorUI': <class 'itk.pyBasePython.vectorvectorUI'>, 'vectorUL': <class 'itk.pyBasePython.vectorUL'>, 'vectorvectorUL': <class 'itk.pyBasePython.vectorvectorUL'>, 'vectorSC': <class 'itk.pyBasePython.vectorSC'>, 'vectorvectorSC': <class 'itk.pyBasePython.vectorvectorSC'>, 'vectorSS': <class 'itk.pyBasePython.vectorSS'>, 'vectorvectorSS': <class 'itk.pyBasePython.vectorvectorSS'>, 'vectorSL': <class 'itk.pyBasePython.vectorSL'>, 'vectorvectorSL': <class 'itk.pyBasePython.vectorvectorSL'>, 'vectorF': <class 'itk.pyBasePython.vectorF'>, 'vectorvectorF': <class 'itk.pyBasePython.vectorvectorF'>, 'vectorD': <class 'itk.pyBasePython.vectorD'>, 'vectorvectorD': <class 'itk.pyBasePython.vectorvectorD'>, 'vectorstring': <class 'itk.pyBasePython.vectorstring'>, 'listB': <class 'itk.pyBasePython.listB'>, 'listI': <class 'itk.pyBasePython.listI'>, 'listUC': <class 'itk.pyBasePython.listUC'>, 'listUS': <class 'itk.pyBasePython.listUS'>, 'listUI': <class 'itk.pyBasePython.listUI'>, 'listUL': <class 'itk.pyBasePython.listUL'>, 'listSC': <class 'itk.pyBasePython.listSC'>, 'listSS': <class 'itk.pyBasePython.listSS'>, 'listSL': <class 'itk.pyBasePython.listSL'>, 'listF': <class 'itk.pyBasePython.listF'>, 'listD': <class 'itk.pyBasePython.listD'>, 'liststring': <class 'itk.pyBasePython.liststring'>, 'setB': <class 'itk.pyBasePython.setB'>, 'setI': <class 'itk.pyBasePython.setI'>, 'setUC': <class 'itk.pyBasePython.setUC'>, 'setUS': <class 'itk.pyBasePython.setUS'>, 'setUI': <class 'itk.pyBasePython.setUI'>, 'setUL': <class 'itk.pyBasePython.setUL'>, 'setULL': <class 'itk.pyBasePython.setULL'>, 'setSC': <class 'itk.pyBasePython.setSC'>, 'setSS': <class 'itk.pyBasePython.setSS'>, 'setSL': <class 'itk.pyBasePython.setSL'>, 'setSLL': <class 'itk.pyBasePython.setSLL'>, 'setF': <class 'itk.pyBasePython.setF'>, 'setD': <class 'itk.pyBasePython.setD'>, 'vectorsetUL': <class 'itk.pyBasePython.vectorsetUL'>, 'mapsetUL': <class 'itk.pyBasePython.mapsetUL'>}, 'collections': <module 'collections' from 'C:\Users\test\.conda\envs\nap-wreg\lib\collections\init.py'>, 'SwigPyIterator': <class 'itk.pyBasePython.SwigPyIterator'>, 'ios_base': <class 'itk.pyBasePython.ios_base'>, 'cvar': , 'ios_base_sync_with_stdio': , 'ios_base_xalloc': , 'ios': <class 'itk.pyBasePython.ios'>, 'ostream': <class 'itk.pyBasePython.ostream'>, 'cin': <Swig Object of type 'std::istream ' at 0x000001BD61ECD0C0>, 'cout': <itk.pyBasePython.ostream; proxy of <Swig Object of type 'std::ostream ' at 0x000001BD61ECD0F0> >, 'cerr': <itk.pyBasePython.ostream; proxy of <Swig Object of type 'std::ostream ' at 0x000001BD61ECD180> >, 'clog': <itk.pyBasePython.ostream; proxy of <Swig Object of type 'std::ostream ' at 0x000001BD61ECD210> >, 'istream': <class 'itk.pyBasePython.istream'>, 'iostream': <class 'itk.pyBasePython.iostream'>, 'endl_cb_ptr': <Swig Object of type 'std::basic_ostream< char,std::char_traits< char > > &()(std::basic_ostream< char,std::char_traits< char > > &)' at 0x000001BD61E00210>, 'endl': , 'ends_cb_ptr': <Swig Object of type 'std::basic_ostream< char,std::char_traits< char > > &()(std::basic_ostream< char,std::char_traits< char > > &)' at 0x000001BD61E00240>, 'ends': , 'flush_cb_ptr': <Swig Object of type 'std::basic_ostream< char,std::char_traits< char > > &()(std::basic_ostream< char,std::char_traits< char > > &)' at 0x000001BD61E128A0>, 'flush': , 'str': <class 'str'>, 'mapULD': <class 'itk.pyBasePython.mapULD'>, 'mapBB': <class 'itk.pyBasePython.mapBB'>, 'mapII': <class 'itk.pyBasePython.mapII'>, 'mapUCUC': <class 'itk.pyBasePython.mapUCUC'>, 'mapUIUI': <class 'itk.pyBasePython.mapUIUI'>, 'mapUSUS': <class 'itk.pyBasePython.mapUSUS'>, 'mapULUL': <class 'itk.pyBasePython.mapULUL'>, 'mapSCSC': <class 'itk.pyBasePython.mapSCSC'>, 'mapSSSS': <class 'itk.pyBasePython.mapSSSS'>, 'mapSLSL': <class 'itk.pyBasePython.mapSLSL'>, 'mapFF': <class 'itk.pyBasePython.mapFF'>, 'mapDD': <class 'itk.pyBasePython.mapDD'>, 'pairI': <class 'itk.pyBasePython.pairI'>, 'pairUI': <class 'itk.pyBasePython.pairUI'>, 'vectorB': <class 'itk.pyBasePython.vectorB'>, 'vectorvectorB': <class 'itk.pyBasePython.vectorvectorB'>, 'vectorI': <class 'itk.pyBasePython.vectorI'>, 'vectorvectorI': <class 'itk.pyBasePython.vectorvectorI'>, 'vectorUC': <class 'itk.pyBasePython.vectorUC'>, 'vectorvectorUC': <class 'itk.pyBasePython.vectorvectorUC'>, 'vectorUS': <class 'itk.pyBasePython.vectorUS'>, 'vectorvectorUS': <class 'itk.pyBasePython.vectorvectorUS'>, 'vectorUI': <class 'itk.pyBasePython.vectorUI'>, 'vectorvectorUI': <class 'itk.pyBasePython.vectorvectorUI'>, 'vectorUL': <class 'itk.pyBasePython.vectorUL'>, 'vectorvectorUL': <class 'itk.pyBasePython.vectorvectorUL'>, 'vectorSC': <class 'itk.pyBasePython.vectorSC'>, 'vectorvectorSC': <class 'itk.pyBasePython.vectorvectorSC'>, 'vectorSS': <class 'itk.pyBasePython.vectorSS'>, 'vectorvectorSS': <class 'itk.pyBasePython.vectorvectorSS'>, 'vectorSL': <class 'itk.pyBasePython.vectorSL'>, 'vectorvectorSL': <class 'itk.pyBasePython.vectorvectorSL'>, 'vectorF': <class 'itk.pyBasePython.vectorF'>, 'vectorvectorF': <class 'itk.pyBasePython.vectorvectorF'>, 'vectorD': <class 'itk.pyBasePython.vectorD'>, 'vectorvectorD': <class 'itk.pyBasePython.vectorvectorD'>, 'vectorstring': <class 'itk.pyBasePython.vectorstring'>, 'listB': <class 'itk.pyBasePython.listB'>, 'listI': <class 'itk.pyBasePython.listI'>, 'listUC': <class 'itk.pyBasePython.listUC'>, 'listUS': <class 'itk.pyBasePython.listUS'>, 'listUI': <class 'itk.pyBasePython.listUI'>, 'listUL': <class 'itk.pyBasePython.listUL'>, 'listSC': <class 'itk.pyBasePython.listSC'>, 'listSS': <class 'itk.pyBasePython.listSS'>, 'listSL': <class 'itk.pyBasePython.listSL'>, 'listF': <class 'itk.pyBasePython.listF'>, 'listD': <class 'itk.pyBasePython.listD'>, 'liststring': <class 'itk.pyBasePython.liststring'>, 'setB': <class 'itk.pyBasePython.setB'>, 'setI': <class 'itk.pyBasePython.setI'>, 'setUC': <class 'itk.pyBasePython.setUC'>, 'setUS': <class 'itk.pyBasePython.setUS'>, 'setUI': <class 'itk.pyBasePython.setUI'>, 'setUL': <class 'itk.pyBasePython.setUL'>, 'setULL': <class 'itk.pyBasePython.setULL'>, 'setSC': <class 'itk.pyBasePython.setSC'>, 'setSS': <class 'itk.pyBasePython.setSS'>, 'setSL': <class 'itk.pyBasePython.setSL'>, 'setSLL': <class 'itk.pyBasePython.setSLL'>, 'setF': <class 'itk.pyBasePython.setF'>, 'setD': <class 'itk.pyBasePython.setD'>, 'vectorsetUL': <class 'itk.pyBasePython.vectorsetUL'>, 'mapsetUL': <class 'itk.pyBasePython.mapsetUL'>}, 'cerr': <itk.pyBasePython.ostream; proxy of <Swig Object of type 'std::ostream ' at 0x000001BD61ECD180> >, 'cin': <Swig Object of type 'std::istream ' at 0x000001BD61ECD0C0>, 'clog': <itk.pyBasePython.ostream; proxy of <Swig Object of type 'std::ostream ' at 0x000001BD61ECD210> >, 'cout': <itk.pyBasePython.ostream; proxy of <Swig Object of type 'std::ostream ' at 0x000001BD61ECD0F0> >, 'cvar': , 'endl': , 'ends': , 'flush': , 'ios': <class 'itk.pyBasePython.ios'>, 'ios_base': <class 'itk.pyBasePython.ios_base'>, 'ios_base_sync_with_stdio': , 'ios_base_xalloc': , 'iostream': <class 'itk.pyBasePython.iostream'>, 'istream': <class 'itk.pyBasePython.istream'>, 'ostream': <class 'itk.pyBasePython.ostream'>, 'string': <class 'str'>, 'map': , 'list': , 'set': , 'vector': } base = <module 'itk.support.base' from 'C:\Users\test\.conda\envs\nap-wreg\lib\site-packages\itk\support\base.py'> 139 self.loaded_lazy_modules.add(module)

File ~.conda\envs\nap-wreg\lib\site-packages\itk\support\base.py:132, in itk_load_swig_module(name='ITKCommon', namespace={'cerr': <itk.pyBasePython.ostream; proxy of <Swig Object of type 'std::ostream ' at 0x000001BD61ECD180> >, 'cin': <Swig Object of type 'std::istream '>, 'clog': <itk.pyBasePython.ostream; proxy of <Swig Object of type 'std::ostream ' at 0x000001BD61ECD210> >, 'cout': <itk.pyBasePython.ostream; proxy of <Swig Object of type 'std::ostream ' at 0x000001BD61ECD0F0> >, 'cvar': , 'endl': , 'ends': , 'flush': , 'ios': <class 'itk.pyBasePython.ios'>, 'ios_base': <class 'itk.pyBasePython.ios_base'>, ...}) 131 loader = LibraryLoader() --> 132 l_module = loader.load(swig_module_name) swig_module_name = 'itk.ITKCommonPython' loader = <itk.support.base.LibraryLoader object at 0x000001BD61DEB610> 134 # OK, now the modules on which this one depends are loaded and 135 # template_feature-instantiated, and the SWIG module for this one is also loaded. 136 # We're going to put the things we load and create in two places: the (...) 142 # stomp on an existing 'swig' namespace, nor do we want to share 'swig' 143 # namespaces between this_module and namespace.

File ~.conda\envs\nap-wreg\lib\site-packages\itk\support\base.py:291, in LibraryLoader.load(self=, name='itk.ITKCommonPython') 290 l_spec = importlib.util.find_spec(name) --> 291 l_spec.loader.exec_module(l_module) # pytype: disable=attribute-error l_module = <module 'itk.ITKCommonPython' from 'C:\Users\test\.conda\envs\nap-wreg\lib\site-packages\itk\support\..\ITKCommonPython.py'> l_spec = ModuleSpec(name='itk.ITKCommonPython', loader=<_frozen_importlib_external.SourceFileLoader object at 0x000001BD61DE1190>, origin='C:\Users\test\.conda\envs\nap-wreg\lib\site-packages\itk\support\..\ITKCommonPython.py') l_spec.loader = <_frozen_importlib_external.SourceFileLoader object at 0x000001BD61DE1190> 292 return l_module

File ~.conda\envs\nap-wreg\lib\site-packages\itk\support..\ITKCommonPython.py:13, in 12 if package or "." in name: ---> 13 from . import _ITKCommonPython 14 else:

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

The above exception was the direct cause of the following exception:

RuntimeError Traceback (most recent call last) File ~.conda\envs\nap-wreg\lib\site-packages\napari_qt\menus\plugins_menu.py:97, in PluginsMenu._add_plugin_actions.._add_toggle_widget(key=('napari-wsireg', 'wsireg2D Main'), hook_type='dock') 94 return 96 if hook_type == 'dock': ---> 97 self._win.add_plugin_dock_widget(key) key = ('napari-wsireg', 'wsireg2D Main') self._win = <napari._qt.qt_main_window.Window object at 0x000001BD517A95E0> self = <napari._qt.menus.plugins_menu.PluginsMenu object at 0x000001BD5E150DC0> 98 else: 99 self._win._add_plugin_function_widget(key)

File ~.conda\envs\nap-wreg\lib\site-packages\napari_qt\qt_main_window.py:678, in Window.add_plugin_dock_widget(self=, plugin_name='napari-wsireg', widget_name='wsireg2D Main') 675 Widget = None 676 dock_kwargs = {} --> 678 result = _npe2.get_widget_contribution(plugin_name, widget_name) plugin_name = 'napari-wsireg' widget_name = 'wsireg2D Main' _npe2 = <module 'napari.plugins._npe2' from 'C:\Users\test\.conda\envs\nap-wreg\lib\site-packages\napari\plugins\_npe2.py'> 679 if result: 680 Widget, widget_name = result

File ~.conda\envs\nap-wreg\lib\site-packages\napari\plugins_npe2.py:114, in get_widget_contribution(plugin_name='napari-wsireg', widget_name='wsireg2D Main') 112 if contrib.plugin_name == plugin_name: 113 if not widget_name or contrib.display_name == widget_name: --> 114 return contrib.get_callable(), contrib.display_name contrib = WidgetContribution(command='napari-wsireg.make_qwidget', display_name='wsireg2D Main', autogenerate=False) contrib.display_name = 'wsireg2D Main' 115 widgets_seen.add(contrib.display_name) 116 if widget_name and widgets_seen:

File ~.conda\envs\nap-wreg\lib\site-packages\npe2\manifest\contributions_widgets.py:50, in WidgetContribution.get_callable(self=WidgetContribution(command='napari-wsireg.make_q...display_name='wsireg2D Main', autogenerate=False), _registry=None) 47 def get_callable( 48 self, _registry: Optional[CommandRegistry] = None 49 ) -> Callable[..., Widget]: ---> 50 func = super().get_callable() 51 if self.autogenerate: 52 from magicgui import magic_factory

File ~.conda\envs\nap-wreg\lib\site-packages\npe2\manifest\utils.py:64, in Executable.get_callable(self=WidgetContribution(command='napari-wsireg.make_q...display_name='wsireg2D Main', autogenerate=False), _registry=) 61 from .._plugin_manager import PluginManager 63 _registry = PluginManager.instance().commands ---> 64 return _registry.get(self.command) _registry = <npe2._command_registry.CommandRegistry object at 0x000001BD4F2C6DC0> self.command = 'napari-wsireg.make_qwidget' self = WidgetContribution(command='napari-wsireg.make_qwidget', display_name='wsireg2D Main', autogenerate=False)

File ~.conda\envs\nap-wreg\lib\site-packages\npe2_command_registry.py:132, in CommandRegistry.get(self=, id='napari-wsireg.make_qwidget') 130 if id not in self._commands: # sourcery skip 131 raise KeyError(f"command {id!r} not registered") --> 132 return self._commands[id].resolve() id = 'napari-wsireg.make_qwidget' self._commands = {'napari-wsireg.make_qwidget': CommandHandler(id='napari-wsireg.make_qwidget', function=None, python_name='napari_wsireg._widget:WsiReg2DMain')} self = <npe2._command_registry.CommandRegistry object at 0x000001BD4F2C6DC0> self._commands[id] = CommandHandler(id='napari-wsireg.make_qwidget', function=None, python_name='napari_wsireg._widget:WsiReg2DMain')

File ~.conda\envs\nap-wreg\lib\site-packages\npe2_command_registry.py:35, in CommandHandler.resolve(self=CommandHandler(id='napari-wsireg.make_qwidget', ...python_name='napari_wsireg._widget:WsiReg2DMain')) 33 self.function = utils.import_python_name(self.python_name) 34 except Exception as e: ---> 35 raise RuntimeError( 36 f"Failed to import command at {self.python_name!r}: {e}" 37 ) from e 39 return self.function

RuntimeError: Failed to import command at 'napari_wsireg._widget:WsiReg2DMain': DLL load failed while importing _ITKCommonPython: The specified module could not be found.

NHPatterson commented 2 years ago

@ved-sharma Yes this definitely looks like an issue with ITK's python package. I'll investigate. Thank you for bringing this to my notice!

NHPatterson commented 2 years ago

@ved-sharma There appears to be an upstream issue with ITK in windows that I'll let them know about.

As a fix, can you try from the terminal:

pip uninstall itk-elastix itk
pip install itk==5.2.0 itk-elastix==0.13.0

then re-try napari-wsireg. It worked for me on Windows 10.

ved-sharma commented 2 years ago

Yes, that worked. Thank you so much!