-
Notifications
You must be signed in to change notification settings - Fork 819
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: BaseSettings
has been moved to the pydantic-settings
package
#457
Comments
Same, solved it downgrading pydantic |
Oh. Thank you for the info! |
In the pydantic v2 the BaseSettings has been moved to a different package. First install pydantic-settings by It should work after that. |
Glad to see it's nothing more complex but this really ought to be fixed on the repo |
BaseSettings
has been moved to the pydantic-settings
package
There's some additional issues related to this as far as I can tell -- |
@dillfrescott was this on a pip install or via git? FastAPI recently upgraded to pydantic v2 which should be much faster however it does introduce some breaking changes. Can you try upgrading to the new |
@abetlen On v0.1.69 I got past the OP issue with .local/venv/llmhost/lib/python3.11/site-packages/pydantic/_internal/_fields.py:126: UserWarning: Field "model_alias" has conflict with protected namespace "model_".
You may be able to resolve this warning by setting `model_config['protected_namespaces'] = ('settings_',)`.
warnings.warn(
/Users/uche/.local/venv/llmhost/lib/python3.11/site-packages/pydantic/_internal/_config.py:261: UserWarning: Valid config keys have changed in V2:
* 'schema_extra' has been renamed to 'json_schema_extra'
warnings.warn(message, UserWarning)
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/Users/uche/.local/venv/llmhost/lib/python3.11/site-packages/llama_cpp/server/__main__.py", line 33, in <module>
for name, field in Settings.__model_fields__.items():
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/uche/.local/venv/llmhost/lib/python3.11/site-packages/pydantic/_internal/_model_construction.py", line 193, in __getattr__
raise AttributeError(item)
AttributeError: __model_fields__. Did you mean: 'model_fields'? |
FYI the 0.1.70 release fixed this error. |
I am also seeing this issue within my docker builds, not sure how to fix it, I am seeing it on all recent versions |
Latest release 0.1.71 fixed this issue for me. |
not currently working on 0.1.73 |
now llama_cpp_python is 0.2.11, this change doesn't work
|
it is not resolved, why did you close it @abetlen ❓ despite to do this: and run this: it doesn’t work for many libraries and it's dependencies 🐍 |
I am running into similar error |
@DLesmes it should be resolved with the |
|
The text was updated successfully, but these errors were encountered: