8

I have just upgraded Python to 3.11 today. Pandas-profiling worked fine before, but now I cannot seem to import it due to the following error:

cannot import name 'DataError' from 'pandas.core.base' (C:\Users\User_name\AppData\Local\Programs\Python\Python311\Lib\site-packages\pandas\core\base.py)

Any help as to how I can fix this?

This is my code:

import pandas as pd
from pandas_profiling import ProfileReport

Pandas version - 1.5.2 Pandas-profiling version - 3.2.0

3
  • Have you tried pip install pandas_profiling? Commented Jan 3, 2023 at 18:12
  • @alibakhtiari Yes Pandas_profiling is successfully installed Commented Jan 4, 2023 at 9:48
  • 1
    New name with new functionality btw ydata-profiling pip install -U ydata-profiling Commented Feb 25, 2023 at 15:44

4 Answers 4

5

Schedule for deprecation

  • ydata-profiling was launched in February 1st.

  • pip install pandas-profiling will still be supported until April 1st, but a warning will be thrown. "from pandas_profiling import ProfileReport " will be supported until April 1st.

  • After April 1st, an error will be thrown if pip install pandas-profiling is used. Use pip install ydata-profiling instead.

  • After April 1st, an error will be thrown if from pandas_profiling import ProfileReport is used. Use from ydata_profiling import ProfileReport instead.

Sign up to request clarification or add additional context in comments.

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
3

You need to simply install the ydata_profiling package and also pandas_profiling; after that, type:

from pandas_profiling import ProfileReport

Then you are good to go.

Comments

2

After more research, I think this is an issue with the new version of python (3.11). I re-installed python 3.10(.9) and pandas_profiling works perfectly fine.

The code to run this different version of python in Jupyter notebook from cmd shell is:

C:\Users\User_name\Your_path_to_python\Python\Python310\python.exe -m notebook

Then just use pandas_profiling normally. If anyone has any suggestions to get it working on python v3.11, let me know.

1 Comment

Thanks for your answer. In case you found a bug in a library, you may want to report it directly to the maintainers, so they get aware and provide a fix. In your case, please follow the instructions on pandas-profiling.ydata.ai/docs/master/pages/support_contrib/…
0

Update Version as of 2024:

import pandas as pd
import ydata_profiling as pp

pandas_profiling is no longer maintained: https://pypi.org/project/pandas-profiling/. Instead, according to the instructions, you should use ydata_profiling.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.