ydataai / ydata-profiling

1 Line of code data quality profiling & exploratory data analysis for Pandas and Spark DataFrames.
https://docs.profiling.ydata.ai
MIT License
12.55k stars 1.69k forks source link

Bug Report #1647

Closed sayakghorai34 closed 1 month ago

sayakghorai34 commented 2 months ago

Current Behaviour

{ "name": "PydanticImportError", "message": "BaseSettings has been moved to the pydantic-settings package. See https://docs.pydantic.dev/2.9/migration/#basesettings-has-moved-to-pydantic-settings for more details.

For further information visit https://errors.pydantic.dev/2.9/u/import-error", "stack": "--------------------------------------------------------------------------- PydanticImportError Traceback (most recent call last) Cell In[26], line 3 1 from pydantic_settings import BaseSettings ----> 3 from pandas_profiling import ProfileReport 4 import pandas as pd

File ~/Downloads/CSI/.venv/lib/python3.11/site-packages/pandas_profiling/init.py:6 1 \"\"\"Main module of pandas-profiling. 2 3 .. include:: ../../README.md 4 \"\"\" ----> 6 from pandas_profiling.controller import pandas_decorator 7 from pandas_profiling.profile_report import ProfileReport 8 from pandas_profiling.version import version

File ~/Downloads/CSI/.venv/lib/python3.11/site-packages/pandas_profiling/controller/pandas_decorator.py:4 1 \"\"\"This file add the decorator on the DataFrame object.\"\"\" 2 from pandas import DataFrame ----> 4 from pandas_profiling.profile_report import ProfileReport 7 def profile_report(df: DataFrame, **kwargs) -> ProfileReport: 8 \"\"\"Profile a DataFrame. 9 10 Args: (...) 15 A ProfileReport of the DataFrame. 16 \"\"\"

File ~/Downloads/CSI/.venv/lib/python3.11/site-packages/pandas_profiling/profile_report.py:13 10 from tqdm.auto import tqdm 11 from visions import VisionsTypeset ---> 13 from pandas_profiling.config import Config, Settings 14 from pandas_profiling.expectations_report import ExpectationsReport 15 from pandas_profiling.model.alerts import AlertType

File ~/Downloads/CSI/.venv/lib/python3.11/site-packages/pandas_profiling/config.py:5 2 from enum import Enum 3 from typing import Any, Dict, List, Optional ----> 5 from pydantic import BaseModel, BaseSettings, Field 8 def _merge_dictionaries(dict1: dict, dict2: dict) -> dict: 9 \"\"\" 10 Recursive merge dictionaries. 11 (...) 14 :return: Merged dictionary 15 \"\"\"

File ~/Downloads/CSI/.venv/lib/python3.11/site-packages/pydantic/init.py:402, in getattr(attr_name) 400 dynamic_attr = _dynamic_imports.get(attr_name) 401 if dynamic_attr is None: --> 402 return _getattr_migration(attr_name) 404 package, module_name = dynamic_attr 406 if module_name == 'module':

File ~/Downloads/CSI/.venv/lib/python3.11/site-packages/pydantic/_migration.py:296, in getattr_migration..wrapper(name) 294 return import_string(REDIRECT_TO_V1[import_path]) 295 if import_path == 'pydantic:BaseSettings': --> 296 raise PydanticImportError( 297 'BaseSettings has been moved to the pydantic-settings package. ' 298 f'See https://docs.pydantic.dev/{version_short()}/migration/#basesettings-has-moved-to-pydantic-settings ' 299 'for more details.' 300 ) 301 if import_path in REMOVED_IN_V2: 302 raise PydanticImportError(f'{import_path} has been removed in V2.')

PydanticImportError: BaseSettings has been moved to the pydantic-settings package. See https://docs.pydantic.dev/2.9/migration/#basesettings-has-moved-to-pydantic-settings for more details.

For further information visit https://errors.pydantic.dev/2.9/u/import-error" }

Expected Behaviour

getting PydanticImportError

Data Description

no such dataset. just installed pandas-profiling using pip and from pandas_profiling import ProfileReport line gives error

Code that reproduces the bug

from pandas_profiling import ProfileReport
import pandas as pd

pandas-profiling version

v3.2.0

Dependencies

Package               Version
--------------------- -----------
aiohappyeyeballs      2.4.0
aiohttp               3.10.5
aiosignal             1.3.1
annotated-types       0.7.0
appnope               0.1.4
asttokens             2.4.1
attrs                 24.2.0
certifi               2024.8.30
charset-normalizer    3.3.2
comm                  0.2.2
contourpy             1.3.0
cycler                0.12.1
debugpy               1.8.5
decorator             5.1.1
executing             2.1.0
filelock              3.16.0
fonttools             4.53.1
frozenlist            1.4.1
fsspec                2024.9.0
htmlmin               0.1.12
idna                  3.8
ImageHash             4.3.1
ipykernel             6.29.5
ipython               8.27.0
jedi                  0.19.1
Jinja2                3.1.4
joblib                1.1.1
jupyter_client        8.6.2
jupyter_core          5.7.2
kiwisolver            1.4.7
lightning-utilities   0.11.7
MarkupSafe            2.1.5
matplotlib            3.9.2
matplotlib-inline     0.1.7
missingno             0.5.2
mpmath                1.3.0
multidict             6.1.0
multimethod           1.12
nest-asyncio          1.6.0
networkx              3.3
numpy                 2.1.1
packaging             24.1
pandas                2.2.2
pandas-profiling      3.2.0
parso                 0.8.4
pexpect               4.9.0
phik                  0.12.4
pillow                10.4.0
pip                   24.2
platformdirs          4.3.2
prompt_toolkit        3.0.47
psutil                6.0.0
ptyprocess            0.7.0
pure_eval             0.2.3
pydantic              2.9.1
pydantic_core         2.23.3
pydantic-settings     2.5.0
Pygments              2.18.0
pyparsing             3.1.4
python-dateutil       2.9.0.post0
python-dotenv         1.0.1
pytz                  2024.1
PyWavelets            1.7.0
PyYAML                6.0.2
pyzmq                 26.2.0
requests              2.32.3
scipy                 1.14.1
seaborn               0.13.2
setuptools            65.5.0
six                   1.16.0
stack-data            0.6.3
sympy                 1.13.2
tangled-up-in-unicode 0.2.0
torch                 2.4.1
torchaudio            2.4.1
torchmetrics          1.4.1
torchvision           0.19.1
tornado               6.4.1
tqdm                  4.66.5
traitlets             5.14.3
typing_extensions     4.12.2
tzdata                2024.1
urllib3               2.2.2
visions               0.7.4
wcwidth               0.2.13
yarl                  1.11.1

OS

macOS 14.6.1

Checklist

fabclmnt commented 1 month ago

Hi @sayakghorai34 ,

thank you for your bug report. Nevertheless you are using pandas-profiling which was deprecated and support removed in 2022.

I suggest that you use a rather more updated version from pypi by using:

pip install ydata-profiling

I'll be closing this issue as this is related to the usage of older versions of the package.