[Error] cannot import name 'ABCIndexClass' from 'pandas.core.dtypes.generic'

import pandas_profiling
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
C:\Users\Public\Documents\ESTsoft\CreatorTemp/ipykernel_19692/1591302161.py in <module>
----> 1 import pandas_profiling

~\anaconda3\lib\site-packages\pandas_profiling\__init__.py in <module>
     10 import pandas_profiling.templates as templates
     11 from .describe import describe
---> 12 from .report import to_html
     13 
     14 NO_OUTPUTFILE = "pandas_profiling.no_outputfile"

~\anaconda3\lib\site-packages\pandas_profiling\report\__init__.py in <module>
      1 """All functionality concerned with presentation to the user."""
----> 2 from pandas_profiling.report.structure.report import get_report_structure
      3 
      4 __all__ = ["get_report_structure"]

~\anaconda3\lib\site-packages\pandas_profiling\report\structure\report.py in <module>
      7 from pandas_profiling.config import Settings
      8 from pandas_profiling.model.alerts import AlertType
----> 9 from pandas_profiling.model.handler import get_render_map
     10 from pandas_profiling.report.presentation.core import (
     11     HTML,

~\anaconda3\lib\site-packages\pandas_profiling\model\handler.py in <module>
      3 
      4 import networkx as nx
----> 5 from visions import VisionsTypeset
      6 
      7 

~\anaconda3\lib\site-packages\visions\__init__.py in <module>
      1 """Core functionality"""
      2 from visions import types, typesets, utils
----> 3 from visions.dtypes.boolean import BoolDtype
      4 from visions.functional import (
      5     cast_to_detected,

~\anaconda3\lib\site-packages\visions\dtypes\boolean.py in <module>
     21 )
     22 from pandas.core.dtypes.dtypes import register_extension_dtype
---> 23 from pandas.core.dtypes.generic import ABCIndexClass, ABCSeries
     24 from pandas.core.dtypes.missing import isna, notna
     25 from pandas.core.tools.numeric import to_numeric

ImportError: cannot import name 'ABCIndexClass' from 'pandas.core.dtypes.generic' (C:\Users\G4560\anaconda3\lib\site-packages\pandas\core\dtypes\generic.py)

WHY?

버젼 상이

해결1

conda로 지우고 재 설치

<삭제>

conda uninstall -c conda-forge pandas-profiling

<설치>

conda install -c conda-forge pandas-profiling

이후 쥬피터노트북에서 설치확인

!pip show pandas_profiling
Name: pandas-profiling
Version: 3.1.1
Summary: Generate profile report for pandas DataFrame
Home-page: https://github.com/pandas-profiling/pandas-profiling
Author: Simon Brugman
Author-email: [email protected]
License: MIT
Location: c:\users\g4560\anaconda3\lib\site-packages
Requires: htmlmin, jinja2, joblib, markupsafe, matplotlib, missingno, multimethod, numpy, pandas, phik, pydantic, PyYAML, requests, scipy, seaborn, tangled-up-in-unicode, tqdm, visions
Required-by: 

해결2 (안해봄)

Pandas v1.3 은 ABCIndexClass 에서 ABCIndex으로 이름이 변경됨.
pandas를 1.2.x series로 Downgrading 한다.

좋은 웹페이지 즐겨찾기