AttributeError:模块' pandas'没有属性'核心'

时间:2017-07-27 17:52:36

标签: python pandas tensorflow

我已在Windows上安装了tensorflow库,然后我的Pandas库停止工作,并且在导入pandas后出现与导入tensorflow相同的问题。

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'
document.body.p

试图重新安装大熊猫和TensorFlow,但没有任何帮助。

6 个答案:

答案 0 :(得分:10)

我刚遇到这个问题并解决了它。这是我的解决方案: 使用conda upgrade --all,然后重新启动笔记本。

答案 1 :(得分:1)

我在Ubuntu 19.04中有熊猫0.25版本,但是为了工作该库 我将熊猫从0.25版本恢复到0.24。

pip install pandas==0.24

(python 3.6)

答案 2 :(得分:0)

我尝试升级conda和重新启动jupyter notebook /卸载熊猫并重新安装熊猫。有效

答案 3 :(得分:0)

1)再次导入,然后

2)更新您的Bash个人资料,之后您将不会再看到此错误,然后

3)重新启动笔记本,希望对您有所帮助

答案 4 :(得分:0)

导入CREATE OR ALTER PROCEDURE dbo.procedure1 (@CustomerId int, @validFrom date, @ValidTo date,@EmployeeID int) AS BEGIN INSERT INTO dbo.CustomerReportLogs( CustomerFullName , LocationName , Amount , Currency , EmployeeId , ValidFrom , ValidTo , EmployeeFullName ) SELECT CONCAT(c.FirstName, ' ', c.LastName) AS CustomerFullName , lo.Name as LocationName , acd.Amount , cu.Name as Currency , acc.EmployeeId , @validFrom as ValidFrom , @ValidTo as ValidTo , CONCAT(emp.FirstName, ' ', emp.LastName) AS EmployeeFullName FROM dbo.Customer as c INNER JOIN dbo.Account AS acc ON acc.CurrencyId=c.Id INNER JOIN dbo.AccountDetails AS acd ON acd.AccountId=acc.Id INNER JOIN dbo.Currency AS cu ON cu.id=acc.CurrencyId INNER JOIN dbo.Location as lo ON lo.Id=acd.LocationId INNER JOIN dbo.Employee AS emp ON emp.ID=acc.EmployeeId WHERE acc.CustomerId = @CustomerId AND acd.TransactionDate BETWEEN @validFrom AND @ValidTo AND acc.EmployeeId = @EmployeeID END 时遇到类似的错误。它回来了

pandas.core.config

当我卸载当前版本(1.1.2)并重新安装旧版本(0.22)的熊猫时,错误消失。 根据{{​​3}},似乎从v0.25开始就发生了错误。

答案 5 :(得分:-1)

使用旧版熊猫:pip install pandas==0.22