Traceback (most recent call last):
File "C:\Users\micro\miniconda3\envs\test\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\micro\miniconda3\envs\test\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\micro\miniconda3\envs\test\lib\site-packages\llama_cpp\server\__main__.py", line 29, in <module>
from llama_cpp.server.app import create_app, Settings
File "C:\Users\micro\miniconda3\envs\test\lib\site-packages\llama_cpp\server\app.py", line 15, in <module>
from pydantic import BaseModel, BaseSettings, Field, create_model_from_typeddict
File "C:\Users\micro\miniconda3\envs\test\lib\site-packages\pydantic\__init__.py", line 206, in __getattr__
return _getattr_migration(attr_name)
File "C:\Users\micro\miniconda3\envs\test\lib\site-packages\pydantic\_migration.py", line 279, in wrapper
raise PydanticImportError(
pydantic.errors.PydanticImportError: `BaseSettings` has been moved to the `pydantic-settings` package. See https://docs.pydantic.dev/2.0.2/migration/#basesettings-has-moved-to-pydantic-settings for more details.
For further information visit https://errors.pydantic.dev/2.0.2/u/import-error
Same, solved it downgrading pydantic
pip install pydantic==1.10.11In the pydantic v2 the BaseSettings has been moved to a different package. First install pydantic-settings by
pip install pydantic-settingsand replacefrom pydantic import BaseSettingswithfrom pydantic_settings import BaseSettingsIt should work after that.
pip install pydantic==1.10.11It works!streamlit_pydanticwon’t work without thispydanticversion downgrade@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
v0.1.69version I just published?@Harshad046, pandas_profiling has been deprecated. Use ydata_profiling instead. Uninstall everything and follow the instructions in the link below: https://github.com/ydataai/ydata-profiling
@DLesmes it should be resolved with the
pydantic-settingsdependency inpyproject.toml. If you run trypython3 -m pip install pydantic-settingsthenpython3 -c "from pydantic_settings import BaseSettings"does that still cause issues? It may be a mismatch between your pip and python intepreter.I am running into similar error
it is not resolved, why did you close it @abetlen ❓
despite to do this:
pip install pydantic-settingsand run this:
from pydantic_settings import BaseSettingsit doesn’t work for many libraries and it’s dependencies 🐍
Glad to see it’s nothing more complex but this really ought to be fixed on the repo