Skip to content
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

PydanticImportError: pydantic.errors:ConfigError has been removed in V2. #1

Open
alexschroeter opened this issue Nov 24, 2023 · 2 comments

Comments

@alexschroeter
Copy link
Collaborator

alexschroeter commented Nov 24, 2023

After reinstalling the environment with python 3.9 it works but during an earlier environment with python 3.10 (I think but deleted the environment) the following error appeared.

We followed the stitching_multi_view.ipynb notebook with napari-stitcher visualization enabled and got the following error:

2023-11-24 10:03:17,147 [Geometry3D WARNING] 'Renderer' is deprecated, using 'Visualizer' instead.
---------------------------------------------------------------------------
PydanticImportError                       Traceback (most recent call last)
Cell In[17], line 16
     14 if VISUALIZE_USING_NAPARI:
     15     import napari
---> 16     from napari_stitcher import viewer_utils

File ~/anaconda3/envs/multiview-stitcher/lib/python3.10/site-packages/napari_stitcher/__init__.py:3
      1 __version__ = "0.0.1"
----> 3 from ._reader import napari_get_reader
      4 from ._sample_data import make_sample_data
      5 from ._widget import StitcherQWidget

File ~/anaconda3/envs/multiview-stitcher/lib/python3.10/site-packages/napari_stitcher/_reader.py:13
      9 from multiview_stitcher import msi_utils
     10 from multiview_stitcher.io import read_mosaic_image_into_list_of_spatial_xarrays,\
     11     METADATA_TRANSFORM_KEY
---> 13 from napari_stitcher import viewer_utils
     16 def napari_get_reader(path):
     17     """A basic implementation of a Reader contribution.
     18 
     19     Parameters
   (...)
     28         same path or list of paths, and returns a list of layer data tuples.
     29     """

File ~/anaconda3/envs/multiview-stitcher/lib/python3.10/site-packages/napari_stitcher/viewer_utils.py:13
      9 from spatial_image import to_spatial_image
     11 from multiview_stitcher import mv_graph, spatial_image_utils, msi_utils, param_utils
---> 13 from napari.experimental import link_layers
     14 from napari.utils import notifications
     17 def image_layer_to_msim(l, viewer):

File ~/anaconda3/envs/multiview-stitcher/lib/python3.10/site-packages/napari/experimental/__init__.py:1
----> 1 from napari.components.experimental.chunk import (
      2     chunk_loader,
      3     synchronous_loading,
      4 )
      5 from napari.layers.utils._link_layers import (
      6     layers_linked,
      7     link_layers,
      8     unlink_layers,
      9 )
     11 __all__ = [
     12     'chunk_loader',
     13     'link_layers',
   (...)
     16     'unlink_layers',
     17 ]

File ~/anaconda3/envs/multiview-stitcher/lib/python3.10/site-packages/napari/components/__init__.py:17
      1 """napari.components provides the public-facing models for widgets
      2 and other utilities that the user will be able to programmatically interact
      3 with.
   (...)
     14     layer-related controls.
     15 """
---> 17 from napari.components.camera import Camera
     18 from napari.components.dims import Dims
     19 from napari.components.layerlist import LayerList

File ~/anaconda3/envs/multiview-stitcher/lib/python3.10/site-packages/napari/components/camera.py:8
      5 from pydantic import validator
      6 from scipy.spatial.transform import Rotation as R
----> 8 from napari.utils.events import EventedModel
      9 from napari.utils.misc import ensure_n_tuple
     10 from napari.utils.translations import trans

File ~/anaconda3/envs/multiview-stitcher/lib/python3.10/site-packages/napari/utils/__init__.py:2
      1 from napari.utils._dask_utils import resize_dask_cache
----> 2 from napari.utils.colormaps import Colormap
      3 from napari.utils.info import citation_text, sys_info
      4 from napari.utils.notebook_display import nbscreenshot

File ~/anaconda3/envs/multiview-stitcher/lib/python3.10/site-packages/napari/utils/colormaps/__init__.py:2
      1 from napari.utils.colormaps.colorbars import make_colorbar
----> 2 from napari.utils.colormaps.colormap import Colormap
      3 from napari.utils.colormaps.colormap_utils import (
      4     ALL_COLORMAPS,
      5     AVAILABLE_COLORMAPS,
   (...)
     17     matplotlib_colormaps,
     18 )
     20 __all__ = [
     21     "make_colorbar",
     22     "Colormap",
   (...)
     36     "matplotlib_colormaps",
     37 ]

File ~/anaconda3/envs/multiview-stitcher/lib/python3.10/site-packages/napari/utils/colormaps/colormap.py:9
      7 from napari.utils.color import ColorArray
      8 from napari.utils.colormaps.colorbars import make_colorbar
----> 9 from napari.utils.events import EventedModel
     10 from napari.utils.events.custom_types import Array
     11 from napari.utils.translations import trans

File ~/anaconda3/envs/multiview-stitcher/lib/python3.10/site-packages/napari/utils/events/__init__.py:17
     15 from napari.utils.events.containers._typed import TypedMutableSequence
     16 from napari.utils.events.event_utils import disconnect_events
---> 17 from napari.utils.events.evented_model import EventedModel
     18 from napari.utils.events.types import SupportsEvents
     20 __all__ = [
     21     'disconnect_events',
     22     'EmitterGroup',
   (...)
     34     'set_event_tracing_enabled',
     35 ]

File ~/anaconda3/envs/multiview-stitcher/lib/python3.10/site-packages/napari/utils/events/evented_model.py:8
      5 from typing import Any, Callable, ClassVar, Dict, Set, Union
      7 import numpy as np
----> 8 from pydantic import BaseModel, PrivateAttr, main, utils
     10 from napari.utils.events.event import EmitterGroup, Event
     11 from napari.utils.misc import pick_equality_operator

File ~/anaconda3/envs/multiview-stitcher/lib/python3.10/site-packages/pydantic/utils.py:31, in init pydantic.utils()

File ~/anaconda3/envs/multiview-stitcher/lib/python3.10/site-packages/pydantic/_migration.py:302, in wrapper(name)

PydanticImportError: `pydantic.errors:ConfigError` has been removed in V2.

For further information visit https://errors.pydantic.dev/2.5/u/import-error

We should probably include running the notebooks into testing and expand the python versions used to newer versions.

@m-albert
Copy link
Collaborator

We should probably include running the notebooks into testing and expand the python versions used to newer versions.

https://github.com/multiview-stitcher/multiview-stitcher/blob/aa9f510127d6558f46125904054922c77dde41d2/tox.ini#L20

One notebook is already being tested (the one depending on input data available within the repo). However with visualization in napari disabled. That's because the notebook lives in multiview-stitcher rather than napari-stitcher. Maybe it'd be a good idea to add it also as a test to napari-stitcher.

@m-albert
Copy link
Collaborator

Problems with napari and pydantic could relate to napari/napari#6358.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants