-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error message at the first step or the Napari_lattice use #103
Comments
Thanks for the report. Please tell me your Python version, attach the result of |
Thanks for your fast answer! |
Just noting at this stage that your Napari Lattice version is quite old. To get the latest version I would advise following https://bioimageanalysiscorewehi.github.io/napari_lattice/installation/. |
I'll try and get back to you |
I didn't catch but, I did exactly this process to update the plugin... I previously started from the Napari interface to update the plugin and add the same error, then I went to the web page you are providing and proceed in a conda installation of the plugin. Didin't change anything... |
Sorry did you mean you tried a fresh environment and you got same error? Assuming you didn't have any other packages installed? Could you post error trace and pip freeze when you try a new python environment? |
I found the error... the LLSM file opener was not the correct one before starting the plugin. Napari gives you 3 choices and I unfortunately select the bad one that still show the image but does not allowed proceeding with the plugin. |
Thanks for the update. |
When intializing the Napari lattice after loading a Zeiss LLSM image, I consistently get thhe following error :
Is it something other got before? Any solution?
AttributeError Traceback (most recent call last)
File C:\Program Files\Python310\lib\site-packages\magicclass_gui_base.py:1175, in build_mgui(widget=PushButtonPlus(value=False, annotation=None, name='Choose_Image_Layer'), func=<function _napari_lattice_widget_wrapper..LLSZWidget.LlszMenu.Choose_Image_Layer>, parent=<napari_lattice._dock_widget._napari_lattice_widget_wrapper..LLSZWidget.LlszMenu object>)
1174 if parent._popup_mode is PopUpMode.popup:
-> 1175 QtGui.QShortcut(QtGui.QKeySequence("Esc"), qmgui, activated=mgui.close)
mgui = <FunctionGuiPlus Choose_Image_Layer(img_layer: napari.layers.base.base.Layer = None, pixel_size_dx: float = 0.1449922, pixel_size_dy: float = 0.1449922, pixel_size_dz: float = 0.3, angle: float = 30.0, select_device: str = 'NVIDIA RTX A2000 8GB Laptop GPU', last_dimension_channel: bool = 'Get_from_metadata', merge_all_channel_layers: bool = True, skew_dir=<DeskewDirection.Y: 2>, set_logging=<Log_Levels.INFO: 20>)>
qmgui = <PyQt5.QtWidgets.QWidget object at 0x00000201AE888550>
QtGui = <module 'qtpy.QtGui' from 'C:\Users\Cyril\AppData\Roaming\Python\Python310\site-packages\qtpy\QtGui.py'>
QtGui.QKeySequence = <class 'PyQt5.QtGui.QKeySequence'>
1177 preview_setting = opt.get("preview", None)
AttributeError: module 'qtpy.QtGui' has no attribute 'QShortcut'
During handling of the above exception, another exception occurred:
MagicGuiBuildError Traceback (most recent call last)
File C:\Program Files\Python310\lib\site-packages\psygnal_signal.py:1196, in SignalInstance._run_emit_loop(self=<SignalInstance 'changed' on PushButtonPlus(valu...lse, annotation=None, name='Choose_Image_Layer')>, args=(False,))
1195 with Signal._emitting(self):
-> 1196 self._run_emit_loop_inner()
self = <SignalInstance 'changed' on PushButtonPlus(value=False, annotation=None, name='Choose_Image_Layer')>
self._run_emit_loop_inner = <bound method SignalInstance._run_emit_loop_immediate of <SignalInstance 'changed' on PushButtonPlus(value=False, annotation=None, name='Choose_Image_Layer')>>
1197 except RecursionError as e:
File C:\Program Files\Python310\lib\site-packages\psygnal_signal.py:1225, in SignalInstance._run_emit_loop_immediate(self=<SignalInstance 'changed' on PushButtonPlus(valu...lse, annotation=None, name='Choose_Image_Layer')>)
1224 for caller in self._slots:
-> 1225 caller.cb(args)
args = (False,)
caller = <StrongFunction on magicclass._gui._base.MagicTemplate._create_widget_from_method..run_function>
File C:\Program Files\Python310\lib\site-packages\psygnal_weak_callback.py:357, in StrongFunction.cb(self=<StrongFunction on magicclass._gui._base.MagicTe..._create_widget_from_method..run_function>, args=())
356 args = args[: self._max_args]
--> 357 self._f(*self._args, *args, **self._kwargs)
args = ()
self._f = <function MagicTemplate._create_widget_from_method..run_function at 0x00000201AE673EB0>
self = <StrongFunction on magicclass._gui._base.MagicTemplate._create_widget_from_method..run_function>
self._args = ()
self._kwargs = {}
File C:\Program Files\Python310\lib\site-packages\magicclass_gui_base.py:788, in MagicTemplate._create_widget_from_method..run_function()
787 def run_function():
--> 788 mgui = _build_mgui(widget, func, self)
widget = PushButtonPlus(value=False, annotation=None, name='Choose_Image_Layer')
func = <function _napari_lattice_widget_wrapper..LLSZWidget.LlszMenu.Choose_Image_Layer at 0x00000201AE673AC0>
self = <napari_lattice._dock_widget._napari_lattice_widget_wrapper..LLSZWidget.LlszMenu object at 0x00000201AE6637F0>
789 _need_title_bar = self._popup_mode.need_title_bar()
File C:\Program Files\Python310\lib\site-packages\magicclass_gui_base.py:1193, in build_mgui(widget=PushButtonPlus(value=False, annotation=None, name='Choose_Image_Layer'), func=<function _napari_lattice_widget_wrapper..LLSZWidget.LlszMenu.Choose_Image_Layer>, parent=<napari_lattice._dock_widget.napari_lattice_widget_wrapper..LLSZWidget.LlszMenu object>)
1192 widget.mgui = None
-> 1193 raise MagicGuiBuildError(msg)
msg = "Exception was raised during building magicgui from method Choose_Image_Layer.\nAttributeError: module 'qtpy.QtGui' has no attribute 'QShortcut'"
1195 return _connect_functiongui_event(mgui, opt)
MagicGuiBuildError: Exception was raised during building magicgui from method Choose_Image_Layer.
AttributeError: module 'qtpy.QtGui' has no attribute 'QShortcut'
The above exception was the direct cause of the following exception:
EmitLoopError Traceback (most recent call last)
File C:\Program Files\Python310\lib\site-packages\magicgui\widgets\bases_value_widget.py:71, in ValueWidget._on_value_change(self=PushButtonPlus(value=False, annotation=None, name='Choose_Image_Layer'), value=False)
69 if value is self.null_value and not self._nullable:
70 return
---> 71 self.changed.emit(value)
value = False
self.changed = <SignalInstance 'changed' on PushButtonPlus(value=False, annotation=None, name='Choose_Image_Layer')>
self = PushButtonPlus(value=False, annotation=None, name='Choose_Image_Layer')
File C:\Program Files\Python310\lib\site-packages\psygnal_signal.py:1176, in SignalInstance.emit(self=<SignalInstance 'changed' on PushButtonPlus(valu...lse, annotation=None, name='Choose_Image_Layer')>, check_nargs=False, check_types=False, *args=(False,))
1172 from ._group import EmissionInfo
1174 SignalInstance._debug_hook(EmissionInfo(self, args))
-> 1176 self._run_emit_loop(args)
self = <SignalInstance 'changed' on PushButtonPlus(value=False, annotation=None, name='Choose_Image_Layer')>
args = (False,)
File C:\Program Files\Python310\lib\site-packages\psygnal_signal.py:1213, in SignalInstance._run_emit_loop(self=<SignalInstance 'changed' on PushButtonPlus(valu...lse, annotation=None, name='Choose_Image_Layer')>, args=(False,))
1205 loop_err = EmitLoopError(
1206 exc=cb_err,
1207 signal=self,
(...)
1210 emit_queue=self._emit_queue,
1211 ).with_traceback(cb_err.traceback)
1212 # this comment will show up in the traceback
-> 1213 raise loop_err from cb_err # emit() call ABOVE || callback error BELOW
loop_err = EmitLoopError('\n\nWhile emitting signal 'magicclass._gui.mgui_ext.PushButtonPlus.changed', a MagicGuiBuildError occurred in a callback:\n\n Signal emitted at: C:\Program Files\Python310\lib\site-packages\magicgui\widgets\bases\_value_widget.py:71, in _on_value_change\n > self.changed.emit(value)\n\n Callback error at: C:\Program Files\Python310\lib\site-packages\magicclass\_gui\_base.py:1193, in build_mgui\n > raise MagicGuiBuildError(msg)\n\n Local variables:\n widget = PushButtonPlus(value=False, annotation=None, name='Choose_Im...\n func = <function _napari_lattice_widget_wrapper..LLSZWidget...\n parent = <napari_lattice._dock_widget._napari_lattice_widget_wrapper....\n sig = <MagicMethodSignature (img_layer: napari.layers.base.base.La...\n opt = {'call_button': None, 'layout': 'vertical', 'labels': True, ...\n call_button = None\n layout = 'vertical'\n labels = True\n auto_call = False\n mgui = <FunctionGuiPlus Choose_Image_Layer(img_layer: napari.layers...\n qmgui = <PyQt5.QtWidgets.QWidget object at 0x00000201AE888550>\n msg = "Exception was raised during building magicgui from method C...\n\nSee MagicGuiBuildError above for original traceback.')
1214 finally:
1215 self._recursion_depth -= 1
File C:\Program Files\Python310\lib\site-packages\psygnal_signal.py:1196, in SignalInstance._run_emit_loop(self=<SignalInstance 'changed' on PushButtonPlus(valu...lse, annotation=None, name='Choose_Image_Layer')>, args=(False,))
1192 self._max_recursion_depth = max(
1193 self._max_recursion_depth, self._recursion_depth
1194 )
1195 with Signal._emitting(self):
-> 1196 self._run_emit_loop_inner()
self = <SignalInstance 'changed' on PushButtonPlus(value=False, annotation=None, name='Choose_Image_Layer')>
self._run_emit_loop_inner = <bound method SignalInstance._run_emit_loop_immediate of <SignalInstance 'changed' on PushButtonPlus(value=False, annotation=None, name='Choose_Image_Layer')>>
1197 except RecursionError as e:
1198 raise RecursionError(
1199 f"RecursionError when "
1200 f"emitting signal {self.name!r} with args {args}"
1201 ) from e
File C:\Program Files\Python310\lib\site-packages\psygnal_signal.py:1225, in SignalInstance._run_emit_loop_immediate(self=<SignalInstance 'changed' on PushButtonPlus(valu...lse, annotation=None, name='Choose_Image_Layer')>)
1223 args = self._emit_queue.popleft()
1224 for caller in self._slots:
-> 1225 caller.cb(args)
args = (False,)
caller = <StrongFunction on magicclass._gui._base.MagicTemplate._create_widget_from_method..run_function>
File C:\Program Files\Python310\lib\site-packages\psygnal_weak_callback.py:357, in StrongFunction.cb(self=<StrongFunction on magicclass._gui._base.MagicTe..._create_widget_from_method..run_function>, args=())
355 if self._max_args is not None:
356 args = args[: self._max_args]
--> 357 self._f(*self._args, *args, **self._kwargs)
args = ()
self._f = <function MagicTemplate._create_widget_from_method..run_function at 0x00000201AE673EB0>
self = <StrongFunction on magicclass._gui._base.MagicTemplate._create_widget_from_method..run_function>
self._args = ()
self._kwargs = {}
File C:\Program Files\Python310\lib\site-packages\magicclass_gui_base.py:788, in MagicTemplate._create_widget_from_method..run_function()
787 def run_function():
--> 788 mgui = _build_mgui(widget, func, self)
widget = PushButtonPlus(value=False, annotation=None, name='Choose_Image_Layer')
func = <function _napari_lattice_widget_wrapper..LLSZWidget.LlszMenu.Choose_Image_Layer at 0x00000201AE673AC0>
self = <napari_lattice._dock_widget._napari_lattice_widget_wrapper..LLSZWidget.LlszMenu object at 0x00000201AE6637F0>
789 _need_title_bar = self._popup_mode.need_title_bar()
790 if not mgui._initialized_for_magicclass: # connect only once
File C:\Program Files\Python310\lib\site-packages\magicclass_gui_base.py:1193, in build_mgui(widget=PushButtonPlus(value=False, annotation=None, name='Choose_Image_Layer'), func=<function _napari_lattice_widget_wrapper..LLSZWidget.LlszMenu.Choose_Image_Layer>, parent=<napari_lattice._dock_widget.napari_lattice_widget_wrapper..LLSZWidget.LlszMenu object>)
1188 msg = (
1189 "Exception was raised during building magicgui from method "
1190 f"{func.name}.\n{e.class.name}: {e}"
1191 )
1192 widget.mgui = None
-> 1193 raise MagicGuiBuildError(msg)
msg = "Exception was raised during building magicgui from method Choose_Image_Layer.\nAttributeError: module 'qtpy.QtGui' has no attribute 'QShortcut'"
1195 return _connect_functiongui_event(mgui, opt)
EmitLoopError:
While emitting signal 'magicclass._gui.mgui_ext.PushButtonPlus.changed', a MagicGuiBuildError occurred in a callback:
Signal emitted at: C:\Program Files\Python310\lib\site-packages\magicgui\widgets\bases_value_widget.py:71, in _on_value_change
> self.changed.emit(value)
Callback error at: C:\Program Files\Python310\lib\site-packages\magicclass_gui_base.py:1193, in _build_mgui
> raise MagicGuiBuildError(msg)
See MagicGuiBuildError above for original traceback.
The text was updated successfully, but these errors were encountered: