I was trying to import the library dataprep, and it looks like it has some problems.
The code was like this:
from dataprep.eda import plot
# plot_correlation,create_report,plot_missing
here is the error:
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[146], line 1
----> 1 from dataprep.eda import plot
File ~\anaconda3\lib\site-packages\dataprep\eda\__init__.py:8
      5 from bokeh.io import output_notebook
      7 from ..utils import is_notebook
----> 8 from .correlation import compute_correlation, plot_correlation, render_correlation
      9 from .create_report import create_report
     10 from .create_db_report import create_db_report
File ~\anaconda3\lib\site-packages\dataprep\eda\correlation\__init__.py:10
      7 import dask.dataframe as dd
      8 import pandas as pd
---> 10 from ..configs import Config
     11 from ..container import Container
     12 from ...progress_bar import ProgressBar
File ~\anaconda3\lib\site-packages\dataprep\eda\configs.py:23
     20 from __future__ import annotations
     22 from typing import Any, Dict, List, Optional, Tuple, Union
---> 23 from pydantic import BaseModel, Field
     24 from ..utils import is_notebook
     27 # This dictionary map the plot names in display to their canonicalized names in Config
ImportError: cannot import name 'BaseModel' from 'pydantic' (unknown location)
How do I resolve the error and successfully import the dataprep library?
                        
Without knowing your versions of
pydanticanddataprep, you should consider the following:dataprep, which should updatepydanticas well (#dependencies). Ifpydanticis not updated, kindly update it manually withpip install -U pydanticorconda.dataprep github__init__.pyinpydantic: check your~\anaconda3\lib\site-packages\pydanticfolder.I had a similar error message earlier this week but from
pygwalker. See this SO: PyGWalker: cannot import name 'Field' from 'pydantic'