hi Dagster team, i just started getting this error...
# ask-community
b
hi Dagster team, i just started getting this error recently. i can’t deploy to my Dagster Hybrid instance anymore because all my Dagster deployment pods have this error in their logs:
Copy code
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/runpy.py", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/local/lib/python3.10/runpy.py", line 146, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/local/lib/python3.10/runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "/base_env/lib/python3.10/site-packages/dagster/__init__.py", line 100, in <module>
    from dagster._config.pythonic_config import (
  File "/base_env/lib/python3.10/site-packages/dagster/_config/pythonic_config/__init__.py", line 23, in <module>
    from pydantic import ConstrainedFloat, ConstrainedInt, ConstrainedStr
  File "/base_env/lib/python3.10/site-packages/pydantic/__init__.py", line 206, in __getattr__
    return _getattr_migration(attr_name)
  File "/base_env/lib/python3.10/site-packages/pydantic/_migration.py", line 285, in wrapper
    raise PydanticImportError(f'`{import_path}` has been removed in V2.')
pydantic.errors.PydanticImportError: `pydantic:ConstrainedFloat` has been removed in V2.

For further information visit <https://errors.pydantic.dev/2.0.2/u/import-error>
I confirmed that this import:
from pydantic import ConstrainedFloat, ConstrainedInt, ConstrainedStr
is in Dagster Cloud version 1.3.13. It seems that pydantic just released version 2.0 last week. Is there any way around this and/or is there a fix in progress?
🤖 1
z
Have you tried setting pydantic<2.0.0 in your project requirements?
Does seem like a bug though, the Dagster team should probably have pydantic<2.0.0 pinned. Might be worth making an issue
I threw together a quick PR for this - https://github.com/dagster-io/dagster/pull/15148
b
Thank you! In the meantime I’ll set
pydantic<2.0.0
on my end
j
yep setting the pin is the right thing to do. dagster 1.3.11 and up should already have the pin, but if you installed other libraries with a pydantic dependency, pip might have installed the lastest version anyway
👍 1