import pandas_profiling as ppf
报错:
ImportError: cannot import name 'DataError' from 'pandas.core.base' (C:\Users\Ma\AppData\Roaming\Python\Python311\site-packages\pandas\core\base.py)
解决方案1:
原因:
pandas_profiling包在2023.4.1已经被废弃,想要使用这个包不仅需要
pip install pandas_profiling
还需要
pip install ydata_profiling
安装这两个包后再运行import pandas_profiling as ppf就不会报错了,但是pandas_profiling 上会出现横线
如果不想出现横线,将pandas_profiling 改为ydata_profiling即可
解决方案2:
将python3.11降为3.10(但是我没试过)