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

Pydantic Error Running configure #101

Open
alexandermichels opened this issue Apr 8, 2024 · 0 comments
Open

Pydantic Error Running configure #101

alexandermichels opened this issue Apr 8, 2024 · 0 comments

Comments

@alexandermichels
Copy link

I installed hydroshare_on_jupyter 0.1.5 from pip and run the configure command, but got the following error:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.9/runpy.py", line 188, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/opt/conda/lib/python3.9/runpy.py", line 147, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/opt/conda/lib/python3.9/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "/opt/conda/lib/python3.9/site-packages/hydroshare_on_jupyter/__init__.py", line 10, in <module>
    from .config_setup import ConfigFile
  File "/opt/conda/lib/python3.9/site-packages/hydroshare_on_jupyter/config_setup.py", line 1, in <module>
    from pydantic import BaseSettings, Field, root_validator, validator
  File "/opt/conda/lib/python3.9/site-packages/pydantic/__init__.py", line 374, in __getattr__
    return _getattr_migration(attr_name)
  File "/opt/conda/lib/python3.9/site-packages/pydantic/_migration.py", line 296, in wrapper
    raise PydanticImportError(
pydantic.errors.PydanticImportError: `BaseSettings` has been moved to the `pydantic-settings` package. See https://docs.pydantic.dev/2.6/migration/#basesettings-has-moved-to-pydantic-settings for more details.

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

Everything worked when following the instructions in the migration link to peg pydantic to 1.*, but pip did take a while solving.

python3 -m pip install pydantic==1.* hydroshare_on_jupyter==0.1.5 && \
    python3 -m hydroshare_on_jupyter configure

It might be useful to either update to work with Pydantic 2 or change the setup.py to require pydantic 1.*. Thanks!

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

1 participant