'AttributeError: module 'pandas' has no attribute 'core'
I have installed the tensorflow library on Windows, then my Pandas library stopped working, and after pandas importing appears the same issue as by importing the tensorflow.
import pandas as pd
AttributeError Traceback (most recent call last)
<ipython-input-24-af55e7023913> in <module>()
----> 1 import pandas as pd
C:\Users\kozyr\Anaconda3\lib\site-packages\pandas\__init__.py in <module>()
40 import pandas.core.config_init
41
---> 42 from pandas.core.api import *
43 from pandas.core.sparse.api import *
44 from pandas.stats.api import *
C:\Users\kozyr\Anaconda3\lib\site-packages\pandas\core\api.py in <module>()
8 from pandas.core.dtypes.missing import isnull, notnull
9 from pandas.core.categorical import Categorical
---> 10 from pandas.core.groupby import Grouper
11 from pandas.io.formats.format import set_eng_float_format
12 from pandas.core.index import (Index, CategoricalIndex, Int64Index,
C:\Users\kozyr\Anaconda3\lib\site-packages\pandas\core\groupby.py in <module>()
47 CategoricalIndex, _ensure_index)
48 from pandas.core.categorical import Categorical
---> 49 from pandas.core.frame import DataFrame
50 from pandas.core.generic import NDFrame, _shared_docs
51 from pandas.core.internals import BlockManager, make_block
C:\Users\kozyr\Anaconda3\lib\site-packages\pandas\core\frame.py in <module>()
65 _maybe_box_datetimelike,
66 _dict_compat)
---> 67 from pandas.core.generic import NDFrame, _shared_docs
68 from pandas.core.index import Index, MultiIndex, _ensure_index
69 from pandas.core.indexing import (maybe_droplevels, convert_to_index_sliceable,
C:\Users\kozyr\Anaconda3\lib\site-packages\pandas\core\generic.py in <module>()
39 from pandas.core.index import (Index, MultiIndex, _ensure_index,
40 InvalidIndexError)
---> 41 import pandas.core.indexing as indexing
42 from pandas.core.indexes.datetimes import DatetimeIndex
43 from pandas.core.indexes.period import PeriodIndex, Period
AttributeError: module 'pandas' has no attribute 'core'
Tried to re-installed pandas and TensorFlow, but nothing helped.
Solution 1:[1]
I have just encountered this problem and solved it. This is my solution way:
use conda upgrade --all
and then restart you notebook.
Solution 2:[2]
Use older version of pandas: pip install pandas==0.22
Solution 3:[3]
I had pandas version 0.25 in Ubuntu 19.04, but for work this library I returned pandas from 0.25 version to 0.24.
pip install pandas==0.24
(python 3.6)
Solution 4:[4]
1) import it again and then
2) update your Bash profile , and you will not see this error after that and then
3) restart your notebook , hope it helps
Solution 5:[5]
I tried both upgrading conda and restarting jupyter notebook/ uninstall pandas and reinstall pandas. It worked
Solution 6:[6]
I faced similar error when importing pandas.core.config
. It returned
AttributeError: module 'pandas.core' has no attribute 'config'
The error disappears when I uninstall current version (1.1.2) and re-install pandas in older version (0.22). It seems like the error had happened since v0.25 according to this issue thread.
Solution 7:[7]
in Colab helped in top_right area Arrow-Down => Disconnect and delete runtime
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Eki |
Solution 2 | garg10may |
Solution 3 | Armel |
Solution 4 | Coder |
Solution 5 | ibozkurt79 |
Solution 6 | thnt |
Solution 7 | JeeyCi |