oughtinc / ice

Interactive Composition Explorer: a debugger for compositional language model programs
https://ice.ought.org
MIT License
529 stars 66 forks source link

Error when running Primer: PydanticImportError #312

Closed pmalmgren closed 1 year ago

pmalmgren commented 1 year ago

While I trying to run the example from the hello world chapter in the Ought Primer I consistently get this error:

Traceback (most recent call last):
  File "/Users/ptmalmgren/src/ice-demo/hello.py", line 3, in <module>
    from ice.recipe import recipe
  File "/Users/ptmalmgren/Library/Caches/pypoetry/virtualenvs/ice-demo-25sS_li7-py3.10/lib/python3.10/site-packages/ice/recipe.py", line 24, in <module>
    from pydantic import BaseSettings
  File "/Users/ptmalmgren/Library/Caches/pypoetry/virtualenvs/ice-demo-25sS_li7-py3.10/lib/python3.10/site-packages/pydantic/__init__.py", line 210, in __getattr__
    return _getattr_migration(attr_name)
  File "/Users/ptmalmgren/Library/Caches/pypoetry/virtualenvs/ice-demo-25sS_li7-py3.10/lib/python3.10/site-packages/pydantic/_migration.py", line 289, in wrapper
    raise PydanticImportError(
pydantic.errors.PydanticImportError: `BaseSettings` has been moved to the `pydantic-settings` package. See https://docs.pydantic.dev/2.1.1/migration/#basesettings-has-moved-to-pydantic-settings for more details.

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

Because setup.cfg has no pinned version for Pydantic, I believe it is defaulting to the latest Pydantic 2.1.1 release which contains backwards-incompatible changes.

stuhlmueller commented 1 year ago

Fixed in #314.