Language/python

[Python] AttributeError: partially initialized module 'pandas' has no attribute 'core' (most likely due to a circular import) 에러 해결

MOMOBOB 2024. 7. 15. 14:37
반응형

 

Error

현상

AttributeError                            Traceback (most recent call last)
Cell In[15], line 2
      1 import random
----> 2 import pandas as pd
      3 import numpy as np
      4 import os

File d:\CHOI\workspace\small-project\venv\lib\site-packages\pandas\__init__.py:138
    120 from pandas.core.reshape.api import (
    121     concat,
    122     lreshape,
   (...)
    134     qcut,
    135 )
    137 from pandas import api, arrays, errors, io, plotting, tseries
--> 138 from pandas import testing
    139 from pandas.util._print_versions import show_versions
    141 from pandas.io.api import (
    142     # excel
    143     ExcelFile,
   (...)
    171     read_spss,
    172 )

File d:\CHOI\workspace\small-project\venv\lib\site-packages\pandas\testing.py:6
      1 """
      2 Public testing utility functions.
      3 """
----> 6 from pandas._testing import (
      7     assert_extension_array_equal,
      8     assert_frame_equal,
      9     assert_index_equal,
     10     assert_series_equal,
     11 )
     13 __all__ = [
     14     "assert_extension_array_equal",
     15     "assert_frame_equal",
     16     "assert_series_equal",
     17     "assert_index_equal",
     18 ]

File d:\CHOI\workspace\small-project\venv\lib\site-packages\pandas\_testing\__init__.py:914
    909     import pytest
    911     return pytest.raises(expected_exception, match=None)
--> 914 cython_table = pd.core.common._cython_table.items()
    917 def get_cython_table_params(ndframe, func_names_and_expected):
    918     """
    919     Combine frame, functions from com._cython_table
    920     keys and expected result.
   (...)
    932         List of three items (DataFrame, function, expected result)
    933     """

AttributeError: partially initialized module 'pandas' has no attribute 'core' (most likely due to a circular import)

 

 

반응형

 


 

Solution

나의경우 pandas 재설치 후 notebook restart 하니까 정상동작함..

pip uninstall pandas
pip install pandas

 

 

 

 


Thank you!

 

 

반응형