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.5k stars 1.68k forks source link

no module named "pydantic.v1" #1532

Open khangnvt opened 9 months ago

khangnvt commented 9 months ago

Current Behaviour

---------------------------------------------------------------------------ModuleNotFoundError Traceback (most recent call last) Cell In[7], line 3 1 import numpy as np 2 import pandas as pd----> 3 from ydata_profiling import ProfileReport 5 df = pd.DataFrame(np.random.rand(100, 5), columns=["a", "b", "c", "d", "e"])

File ~\AppData\Roaming\Python\Python311\site-packages\ydata_profiling__init__.py:14 10 warnings.simplefilter("ignore", category=NumbaDeprecationWarning) 12 import importlib.util # isort:skip # noqa---> 14 from ydata_profiling.compare_reports import compare # isort:skip # noqa 15 from ydata_profiling.controller import pandas_decorator # isort:skip # noqa 16 from ydata_profiling.profile_report import ProfileReport # isort:skip # noqa File ~\AppData\Roaming\Python\Python311\site-packages\ydata_profiling\compare_reports.py:9 6 import pandas as pd 7 from dacite import from_dict----> 9 from ydata_profiling.config import Correlation, Settings 10 from ydata_profiling.model import BaseDescription 11 from ydata_profiling.model.alerts import Alert

File ~\AppData\Roaming\Python\Python311\site-packages\ydata_profiling\config.py:7 4 from typing import Any, Dict, List, Optional, Tuple, Union 6 import yaml----> 7 from pydantic.v1 import BaseModel, BaseSettings, Field, PrivateAttr 10 def _merge_dictionaries(dict1: dict, dict2: dict) -> dict: 11 """ 12 Recursive merge dictionaries. 13 (...) 16 :return: Merged dictionary 17 """

ModuleNotFoundError: No module named 'pydantic.v1'

Expected Behaviour

Successfully import

Data Description

df = pd.DataFrame(np.random.rand(100, 5), columns=["a", "b", "c", "d", "e"])

Code that reproduces the bug

import numpy as np
import pandas as pd
from ydata_profiling import ProfileReport

df = pd.DataFrame(np.random.rand(100, 5), columns=["a", "b", "c", "d", "e"])

pandas-profiling version

0.7.5

Dependencies

pandas == 2.0.3
numpy == 1.24.3

OS

Windows 10

Checklist

dkinga commented 7 months ago

I've encountered same issue. It looks like you need to install pydantic >= 2 It worked for me with moving from 1.8.2 to 2.6.0

pip install pydantic==2.6.0

Eileen1214 commented 1 week ago

what is version about pandas-profiling ? I've installed pydantic=2.6.0 but nothing