haesleinhuepf / devbio-napari

BSD 3-Clause "New" or "Revised" License
43 stars 13 forks source link

lxml_html_clean needs to be installed separately #50

Open haesleinhuepf opened 1 month ago

haesleinhuepf commented 1 month ago

The following error can be fixed using pip install lxml_html_clean:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[1], line 1
----> 1 from napari_assistant._categories import CATEGORIES
      3 try:
      4     import pyclesperanto as cle

File [~\miniforge3\envs\devbio-napari-env\Lib\site-packages\napari_assistant\__init__.py:1](http://localhost:8888/lab/workspaces/auto-B/tree/docs/~/miniforge3/envs/devbio-napari-env/Lib/site-packages/napari_assistant/__init__.py#line=0)
----> 1 from ._gui import Assistant
      2 from .__main__ import main
      3 from ._viewer import Viewer

File [~\miniforge3\envs\devbio-napari-env\Lib\site-packages\napari_assistant\_gui\__init__.py:1](http://localhost:8888/lab/workspaces/auto-B/tree/docs/~/miniforge3/envs/devbio-napari-env/Lib/site-packages/napari_assistant/_gui/__init__.py#line=0)
----> 1 from ._Assistant import Assistant

File [~\miniforge3\envs\devbio-napari-env\Lib\site-packages\napari_assistant\_gui\_Assistant.py:9](http://localhost:8888/lab/workspaces/auto-B/tree/docs/~/miniforge3/envs/devbio-napari-env/Lib/site-packages/napari_assistant/_gui/_Assistant.py#line=8)
      7 from qtpy.QtGui import QCursor
      8 from typing import Union
----> 9 from .._categories import CATEGORIES, Category, filter_categories, find_function, get_category_of_function
     10 from ._button_grid import ButtonGrid, _get_highlight_brush, _get_background_brush
     11 from ._category_widget import make_gui_for_category

File [~\miniforge3\envs\devbio-napari-env\Lib\site-packages\napari_assistant\_categories.py:6](http://localhost:8888/lab/workspaces/auto-B/tree/docs/~/miniforge3/envs/devbio-napari-env/Lib/site-packages/napari_assistant/_categories.py#line=5)
      4 import numpy as np
      5 import napari
----> 6 from napari.layers import Image, Labels, Layer
      7 from typing_extensions import Annotated
      8 import inspect

File [~\miniforge3\envs\devbio-napari-env\Lib\site-packages\napari\layers\__init__.py:9](http://localhost:8888/lab/workspaces/auto-B/tree/docs/~/miniforge3/envs/devbio-napari-env/Lib/site-packages/napari/layers/__init__.py#line=8)
      1 """Layers are the viewable objects that can be added to a viewer.
      2 
      3 Custom layers must inherit from Layer and pass along the
      4 `visual node <https://vispy.org/api/vispy.scene.visuals.html>`_
      5 to the super constructor.
      6 """
      7 import inspect as _inspect
----> 9 from napari.layers.base import Layer
     10 from napari.layers.image import Image
     11 from napari.layers.labels import Labels

File ~\miniforge3\envs\devbio-napari-env\Lib\site-packages\napari\layers\base\__init__.py:1
----> 1 from napari.layers.base._base_constants import ActionType
      2 from napari.layers.base.base import Layer, no_op
      4 __all__ = ['Layer', 'no_op', 'ActionType']

File [~\miniforge3\envs\devbio-napari-env\Lib\site-packages\napari\layers\base\_base_constants.py:4](http://localhost:8888/lab/workspaces/auto-B/tree/docs/~/miniforge3/envs/devbio-napari-env/Lib/site-packages/napari/layers/base/_base_constants.py#line=3)
      1 from collections import OrderedDict
      2 from enum import IntEnum, auto
----> 4 from napari.utils.misc import StringEnum
      5 from napari.utils.translations import trans
      8 class Blending(StringEnum):

File [~\miniforge3\envs\devbio-napari-env\Lib\site-packages\napari\utils\__init__.py:8](http://localhost:8888/lab/workspaces/auto-B/tree/docs/~/miniforge3/envs/devbio-napari-env/Lib/site-packages/napari/utils/__init__.py#line=7)
      2 from napari.utils.colormaps.colormap import (
      3     Colormap,
      4     CyclicLabelColormap,
      5     DirectLabelColormap,
      6 )
      7 from napari.utils.info import citation_text, sys_info
----> 8 from napari.utils.notebook_display import nbscreenshot
      9 from napari.utils.progress import cancelable_progress, progrange, progress
     11 __all__ = (
     12     'Colormap',
     13     'DirectLabelColormap',
   (...)
     21     'sys_info',
     22 )

File [~\miniforge3\envs\devbio-napari-env\Lib\site-packages\napari\utils\notebook_display.py:9](http://localhost:8888/lab/workspaces/auto-B/tree/docs/~/miniforge3/envs/devbio-napari-env/Lib/site-packages/napari/utils/notebook_display.py#line=8)
      7     from lxml.etree import ParserError
      8     from lxml.html import document_fromstring
----> 9     from lxml.html.clean import Cleaner
     11     lxml_unavailable = False
     12 except ModuleNotFoundError:

File [~\miniforge3\envs\devbio-napari-env\Lib\site-packages\lxml\html\clean.py:18](http://localhost:8888/lab/workspaces/auto-B/tree/docs/~/miniforge3/envs/devbio-napari-env/Lib/site-packages/lxml/html/clean.py#line=17)
      8     __all__ = [
      9         "clean_html",
     10         "clean",
   (...)
     15         "word_break_html",
     16     ]
     17 except ImportError:
---> 18     raise ImportError(
     19         "lxml.html.clean module is now a separate project lxml_html_clean[.\n](http://localhost:8888/lab/workspaces/auto-B/tree/docs/n)"
     20         "Install lxml[html_clean] or lxml_html_clean directly."
     21     ) from None

ImportError: lxml.html.clean module is now a separate project lxml_html_clean.
Install lxml[html_clean] or lxml_html_clean directly.