4

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

JT_uhmbt
  • 61
  • 1
  • 7

3 Answers3

3

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.

  • 2
    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](/help/how-to-answer). – Community Apr 08 '23 at 07:10
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.

JT_uhmbt
  • 61
  • 1
  • 7
  • 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 https://pandas-profiling.ydata.ai/docs/master/pages/support_contrib/help_troubleshoot.html – Carlos Horn Jan 05 '23 at 12:42
2

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.

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77