Skip to content

Dependency mismatch when upgrading from rc14 to 3.0.0 (pydantic, napari) #3343

@tsievert

Description

@tsievert

Is there an existing issue for this?

  • I have searched the existing issues

Operating System

Win 11

DeepLabCut version

rc14 to 3.0.0

What engine are you using?

pytorch

DeepLabCut mode

single animal

Device type

cpu

Bug description 🐛

I tried upgrading my rc14 environment to the full 3.0.0 release, but it throws a warning during the upgrade and then fails to load the GUI.

From what I can tell, the issue is that napari requires pydantic<2, but when you downgrade that, you get deeplabcut 3.0.0 requires pydantic<3,>=2, so you are stuck in a hybrid state.

Luckily a fresh install in a new env is working

Steps To Reproduce

  1. Have existing rc14 env
  2. pip install --upgrade deeplabcut
  3. python -m deeplabcut
  4. see error

Relevant log output

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
napari 0.4.18 requires pydantic<2,>=1.9.0, but you have pydantic 2.13.4 which is incompatible.
Successfully installed MarkupSafe-3.0.3 Shapely-2.1.2 albumentations-1.4.3 annotated-doc-0.0.4 annotated-types-0.7.0 anyio-4.13.0 blosc2-4.3.3 bottleneck-1.6.0 certifi-2026.5.20 charset_normalizer-3.4.7 click-8.4.1 colorama-0.4.6 contourpy-1.3.2 cycler-0.12.1 deeplabcut-3.0.0 dlclibrary-0.0.12 einops-0.8.2 exceptiongroup-1.3.1 filelock-3.15.4 filterpy-1.4.5 fonttools-4.63.0 fsspec-2026.4.0 h11-0.16.0 hf-xet-1.5.0 httpcore-1.0.9 httpx-0.28.1 huggingface-hub-1.16.1 idna-3.16 imageio-2.37.3 imageio-ffmpeg-0.6.0 imgaug-0.4.0 jinja2-3.1.6 joblib-1.5.3 kiwisolver-1.5.0 lazy-loader-0.5 llvmlite-0.47.0 markdown-it-py-4.2.0 matplotlib-3.8.4 mdurl-0.1.2 mpmath-1.3.0 msgpack-1.1.2 ndindex-1.10.1 networkx-3.4.2 numba-0.65.1 numexpr-2.14.1 numpy-1.26.4 opencv-python-4.11.0.86 opencv-python-headless-4.11.0.86 packaging-26.2 pandas-2.3.3 patsy-1.0.2 pillow-12.2.0 py-cpuinfo-9.0.0 pycocotools-2.0.11 pydantic-2.13.4 pydantic-core-2.46.4 pygments-2.20.0 pyparsing-3.3.2 python-dateutil-2.9.0.post0 pytz-2026.2 pyyaml-6.0.3 requests-2.34.2 rich-15.0.0 ruamel-yaml-0.19.1 safetensors-0.7.0 scikit-image-0.25.2 scikit-learn-1.7.2 scipy-1.15.3 setuptools-81.0.0 shellingham-1.5.4 six-1.17.0 statsmodels-0.14.6 sympy-1.14.0 tables-3.10.1 threadpoolctl-3.6.0 tifffile-2025.5.10 timm-1.0.27 torch-2.12.0 torchvision-0.27.0 tqdm-4.67.3 typer-0.25.1 typing-extensions-4.15.0 typing-inspection-0.4.2 tzdata-2026.2 urllib3-2.7.0

(DEEPLABCUT) C:\Windows\System32>python -m deeplabcut
Starting GUI...
Traceback (most recent call last):
  File "C:\Users\thorb\anaconda3\envs\DEEPLABCUT\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\thorb\anaconda3\envs\DEEPLABCUT\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\thorb\anaconda3\envs\DEEPLABCUT\lib\site-packages\deeplabcut\__main__.py", line 36, in <module>
    main()
  File "C:\Users\thorb\anaconda3\envs\DEEPLABCUT\lib\site-packages\deeplabcut\__main__.py", line 27, in main
    launch_dlc()
  File "C:\Users\thorb\anaconda3\envs\DEEPLABCUT\lib\site-packages\deeplabcut\gui\launch_script.py", line 64, in launch_dlc
    from deeplabcut.gui.window import MainWindow
  File "C:\Users\thorb\anaconda3\envs\DEEPLABCUT\lib\site-packages\deeplabcut\gui\window.py", line 21, in <module>
    from napari_deeplabcut import __version__ as NAPARI_DLC_VERSION
  File "C:\Users\thorb\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari_deeplabcut\__init__.py", line 26, in <module>
    from ._reader import (
  File "C:\Users\thorb\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari_deeplabcut\_reader.py", line 14, in <module>
    from napari.types import LayerData
  File "C:\Users\thorb\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari\types.py", line 206, in <module>
    _register_types_with_magicgui()
  File "C:\Users\thorb\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari\types.py", line 166, in _register_types_with_magicgui
    from napari.utils import _magicgui as _mgui
  File "C:\Users\thorb\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari\utils\__init__.py", line 2, in <module>
    from napari.utils.colormaps import Colormap
  File "C:\Users\thorb\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari\utils\colormaps\__init__.py", line 2, in <module>
    from napari.utils.colormaps.colormap import Colormap
  File "C:\Users\thorb\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari\utils\colormaps\colormap.py", line 9, in <module>
    from napari.utils.events import EventedModel
  File "C:\Users\thorb\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari\utils\events\__init__.py", line 17, in <module>
    from napari.utils.events.evented_model import EventedModel
  File "C:\Users\thorb\anaconda3\envs\DEEPLABCUT\lib\site-packages\napari\utils\events\evented_model.py", line 66, in <module>
    class EventedMetaclass(main.ModelMetaclass):
  File "C:\Users\thorb\anaconda3\envs\DEEPLABCUT\lib\site-packages\pydantic\_migration.py", line 314, in wrapper
    raise AttributeError(f'module {module!r} has no attribute {name!r}')
AttributeError: module 'pydantic.main' has no attribute 'ModelMetaclass'

Anything else?

No response

Code of Conduct

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions