Reputation: 1
I am trying to make a profile report on a data i imported to pandas. but it give me a pydantic error
import pandas_profiling
profile_report = df.profile_report()
i also tried methods like
from ydata_profiling import ProfileReport
but I get this error:
PydanticImportError: BaseSettings
has been moved to the pydantic-settings
package. See https://docs.pydantic.dev/2.4/migration/#basesettings-has-moved-to-pydantic-settings for more details. For further information visit https://errors.pydantic.dev/2.4/u/import-error
Traceback:
File "C:\Users\HP\AppData\Local\Programs\Python\Python311\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 541, in run_script
exec(code, module.dict)
File "C:\Users\HP\OneDrive\Desktop\AutoML\app.py", line 5, in
import pandas_profiling
File "C:\Users\HP\AppData\Local\Programs\Python\Python311\Lib\site-packages\pandas_profiling_init.py", line 8, in
from ydata_profiling.compare_reports import compare
File "C:\Users\HP\AppData\Local\Programs\Python\Python311\Lib\site-packages\ydata_profiling_init_.py", line 7, in
from ydata_profiling.compare_reports import compare
File "C:\Users\HP\AppData\Local\Programs\Python\Python311\Lib\site-packages\ydata_profiling\compare_reports.py", line 9, in
from ydata_profiling.config import Correlation, Settings
File "C:\Users\HP\AppData\Local\Programs\Python\Python311\Lib\site-packages\ydata_profiling\config.py", line 7, in
from pydantic import BaseModel, BaseSettings, Field, PrivateAttr
File "C:\Users\HP\AppData\Local\Programs\Python\Python311\Lib\site-packages\pydantic_init_.py", line 218, in getattr
return _getattr_migration(attr_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\HP\AppData\Local\Programs\Python\Python311\Lib\site-packages\pydantic_migration.py", line 294, in wrapper
raise PydanticImportError(
Upvotes: 0
Views: 753
Reputation: 60
It can be a simple versioning problem, have you checked requirements at https://github.com/ydataai/ydata-profiling/blob/develop/requirements.txt? For pydantic you need pydantic>=1.8.1, <2 for ydata-profling 4.6.0.
Upvotes: 0