AllenCell / napari-allencell-segmenter

A plugin that enables image segmentation provided by Allen Institute for Cell Science
BSD 3-Clause "New" or "Revised" License
16 stars 6 forks source link

Cannot start the plugin in Napari #129

Closed lynwilhelm closed 2 years ago

lynwilhelm commented 2 years ago

I tried to open the plugin but it fails.

Description

I cannot see/access the the plugin widget

Error message

First error is for Workflow and second is for Batch Processing

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/Applications/napari.app/Contents/Resources/app/napari/_qt/menus/plugins_menu.py in _add_toggle_widget(key=('napari-allencell-segmenter', 'Batch processing'), hook_type='dock')
     84 
     85                         if hook_type == 'dock':
---> 86                             self._win.add_plugin_dock_widget(*key)
        global self._win.add_plugin_dock_widget = undefined
        key = ('napari-allencell-segmenter', 'Batch processing')
     87                         else:
     88                             self._win._add_plugin_function_widget(*key)

/Applications/napari.app/Contents/Resources/app/napari/_qt/qt_main_window.py in add_plugin_dock_widget(self=, plugin_name='napari-allencell-segmenter', widget_name='Batch processing')
    675         # Add dock widget
    676         dock_kwargs.pop('name', None)
--> 677         dock_widget = self.add_dock_widget(wdg, name=full_name, **dock_kwargs)
        dock_widget = undefined
        self.add_dock_widget = >
        wdg = 
        global name = undefined
        full_name = 'napari-allencell-segmenter: Batch processing'
        dock_kwargs = {}
    678         return dock_widget, wdg
    679 

/Applications/napari.app/Contents/Resources/app/napari/_qt/qt_main_window.py in add_dock_widget(self=, widget=, name='napari-allencell-segmenter: Batch processing', area='right', allowed_areas=None, shortcut=, add_vertical_stretch=True, menu=None)
    777             )
    778         else:
--> 779             dock_widget = QtViewerDockWidget(
        dock_widget = undefined
        global QtViewerDockWidget = 
        self.qt_viewer = 
        widget = 
        name = 'napari-allencell-segmenter: Batch processing'
        area = 'right'
        allowed_areas = None
        add_vertical_stretch = True
    780                 self.qt_viewer,
    781                 widget,

/Applications/napari.app/Contents/Resources/app/napari/_qt/widgets/qt_viewer_dock_widget.py in __init__(self=, qt_viewer=, widget=, name='napari-allencell-segmenter: Batch processing', area='right', allowed_areas=PySide2.QtCore.Qt.DockWidgetArea.AllDockWidgetAreas, shortcut=None, object_name='', add_vertical_stretch=True)
    130 
    131         is_vertical = area in {'left', 'right'}
--> 132         widget = combine_widgets(widget, vertical=is_vertical)
        widget = 
        global combine_widgets = 
        global vertical = undefined
        is_vertical = True
    133         self.setWidget(widget)
    134         if is_vertical and add_vertical_stretch:

/Applications/napari.app/Contents/Resources/app/napari/_qt/utils.py in combine_widgets(widgets=, vertical=True)
    265                 container.layout().addWidget(widget)
    266             return container
--> 267     raise TypeError(
        global TypeError = undefined
        global trans._ = >
    268         trans._('"widget" must be a QWidget or a sequence of QWidgets')
    269     )

TypeError: "widget" must be a QWidget or a sequence of QWidgets
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/Applications/napari.app/Contents/Resources/app/napari/_qt/menus/plugins_menu.py in _add_toggle_widget(key=('napari-allencell-segmenter', 'Workflow editor'), hook_type='dock')
     84 
     85                         if hook_type == 'dock':
---> 86                             self._win.add_plugin_dock_widget(*key)
        global self._win.add_plugin_dock_widget = undefined
        key = ('napari-allencell-segmenter', 'Workflow editor')
     87                         else:
     88                             self._win._add_plugin_function_widget(*key)

/Applications/napari.app/Contents/Resources/app/napari/_qt/qt_main_window.py in add_plugin_dock_widget(self=, plugin_name='napari-allencell-segmenter', widget_name='Workflow editor')
    675         # Add dock widget
    676         dock_kwargs.pop('name', None)
--> 677         dock_widget = self.add_dock_widget(wdg, name=full_name, **dock_kwargs)
        dock_widget = undefined
        self.add_dock_widget = >
        wdg = 
        global name = undefined
        full_name = 'napari-allencell-segmenter: Workflow editor'
        dock_kwargs = {}
    678         return dock_widget, wdg
    679 

/Applications/napari.app/Contents/Resources/app/napari/_qt/qt_main_window.py in add_dock_widget(self=, widget=, name='napari-allencell-segmenter: Workflow editor', area='right', allowed_areas=None, shortcut=, add_vertical_stretch=True, menu=None)
    777             )
    778         else:
--> 779             dock_widget = QtViewerDockWidget(
        dock_widget = undefined
        global QtViewerDockWidget = 
        self.qt_viewer = 
        widget = 
        name = 'napari-allencell-segmenter: Workflow editor'
        area = 'right'
        allowed_areas = None
        add_vertical_stretch = True
    780                 self.qt_viewer,
    781                 widget,

/Applications/napari.app/Contents/Resources/app/napari/_qt/widgets/qt_viewer_dock_widget.py in __init__(self=, qt_viewer=, widget=, name='napari-allencell-segmenter: Workflow editor', area='right', allowed_areas=PySide2.QtCore.Qt.DockWidgetArea.AllDockWidgetAreas, shortcut=None, object_name='', add_vertical_stretch=True)
    130 
    131         is_vertical = area in {'left', 'right'}
--> 132         widget = combine_widgets(widget, vertical=is_vertical)
        widget = 
        global combine_widgets = 
        global vertical = undefined
        is_vertical = True
    133         self.setWidget(widget)
    134         if is_vertical and add_vertical_stretch:

/Applications/napari.app/Contents/Resources/app/napari/_qt/utils.py in combine_widgets(widgets=, vertical=True)
    265                 container.layout().addWidget(widget)
    266             return container
--> 267     raise TypeError(
        global TypeError = undefined
        global trans._ = >
    268         trans._('"widget" must be a QWidget or a sequence of QWidgets')
    269     )

TypeError: "widget" must be a QWidget or a sequence of QWidgets

Expected Behavior

Plugin widget should appear in the napari GUI

Reproduction

Please list the exact steps we can take to reproduce this bug.

  1. Click on Plugin > napari-allencell-segmenter > workflow editor (or batch processing)
  2. Error message notification popped up in UI
  3. No plugin windows opened

Environment

Operating system (ex. MacOS Big Sur): MacOs Catalina Python version (ex. 3.8): 2.7.16 How did you install the napari viewer (as a bundled app or through command line with pip)?: Bundled App

schoinh commented 2 years ago

I wonder if this is because we don't support Python 2?

schoinh commented 2 years ago

@lynwilhelm Which version of napari did you install? (Sorry, I need to add this to the bug report template.) This page is confusing because it tags v0.4.12 as the latest but also says that a version released in Nov 2020 (nightly build) is also "latest."

You should be able to check the version by going to Help -> napari info in napari.

schoinh commented 2 years ago

I was able to reproduce this bug after installing napari (v0.4.12) through the bundled app download. I was not able to reproduce this bug after installing napari (v0.4.12) via pip.

schoinh commented 2 years ago

Found a similar error in this old (closed) issue on the napari repo, maybe related to magicgui: https://github.com/napari/napari/issues/2733