解决AttributeError:模块'pandas'没有使用command-prompt或pycharm属性'core'

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决AttributeError:模块'pandas'没有使用command-prompt或pycharm属性'core'相关的知识,希望对你有一定的参考价值。

我因为错误而苦苦挣扎

AttributeError:模块'pandas'没有属性'core'

很长一段时间请参考下面“进口熊猫”的输出。我在网上搜索过这个错误,并在许多地方搜索了很多东西,但无法解决它。问题是当我使用Windows 7专业版时,提供的解决方案更适合其他操作系统,如Mac和Linux。

   Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:UsersIshanLPycharmProjectsProject1venvlibsite-packagespandas\__init__.py", line 42, in <module>
    from pandas.core.api import *
  File "C:UsersIshanLPycharmProjectsProject1venvlibsite-packagespandascoreapi.py", line 10, in <module>
    from pandas.core.groupby.groupby import Grouper
  File "C:UsersIshanLPycharmProjectsProject1venvlibsite-packagespandascoregroupby\__init__.py", line 2, in <module>
    from pandas.core.groupby.groupby import (
  File "C:UsersIshanLPycharmProjectsProject1venvlibsite-packagespandascoregroupbygroupby.py", line 49, in <module>
    from pandas.core.frame import DataFrame
  File "C:UsersIshanLPycharmProjectsProject1venvlibsite-packagespandascoreframe.py", line 74, in <module>
    from pandas.core.series import Series
  File "C:UsersIshanLPycharmProjectsProject1venvlibsite-packagespandascoreseries.py", line 66, in <module>
    import pandas.core.ops as ops
AttributeError: module 'pandas' has no attribute 'core'

如果您需要任何其他细节,请询问。如果你能帮我解决这个问题,我将非常高兴。谢谢

P.S如果您可以建议使用终端不使用互联网的解决方案,例如“pip install pandas”,因为公司的网络访问受到限制。所以,我通过whl文件安装了pandas的所有依赖项,这些文件可以通过公司提供的访问权限下载。

编辑:我第一次执行pandas它显示并休息它显示上面显示的错误

>>> import pandas
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:UsersIshanLPycharmProjectsProject1venvlibsite-packagespandas\__init__.py", line 42, in <module>
    from pandas.core.api import *
  File "C:UsersIshanLPycharmProjectsProject1venvlibsite-packagespandascoreapi.py", line 10, in <module>
    from pandas.core.groupby.groupby import Grouper
  File "C:UsersIshanLPycharmProjectsProject1venvlibsite-packagespandascoregroupby\__init__.py", line 2, in <module>
    from pandas.core.groupby.groupby import (
  File "C:UsersIshanLPycharmProjectsProject1venvlibsite-packagespandascoregroupbygroupby.py", line 49, in <module>
    from pandas.core.frame import DataFrame
  File "C:UsersIshanLPycharmProjectsProject1venvlibsite-packagespandascoreframe.py", line 74, in <module>
    from pandas.core.series import Series
  File "C:UsersIshanLPycharmProjectsProject1venvlibsite-packagespandascoreseries.py", line 3978, in <module>
    Series._add_series_or_dataframe_operations()
  File "C:UsersIshanLPycharmProjectsProject1venvlibsite-packagespandascoregeneric.py", line 8891, in _add_series_or_dataframe_operations
    from pandas.core import window as rwindow
  File "C:UsersIshanLPycharmProjectsProject1venvlibsite-packagespandascorewindow.py", line 36, in <module>
    import pandas._libs.window as _window
ImportError: DLL load failed: The specified module could not be found.
答案
conda upgrade --all 

升级您的库并重新启动您的笔记本。这将完成工作。

以上是关于解决AttributeError:模块'pandas'没有使用command-prompt或pycharm属性'core'的主要内容,如果未能解决你的问题,请参考以下文章

解决AttributeError: XXX instance has no attribute 'xxx'的问题(新手必备)

Python 脚本报错AttributeError: 'module 'yyy' has no attribute 'xxx'的解决方法

解决报错:在pycharm中使用os模块获取当前进程id,出现错误:AttributeError: module ‘os‘ has no attribute ‘getgid‘(图文并茂!!!)(代码片

解决:pipenv shell报错:AttributeError: 'module' object has no attribute 'run'

text AttributeError:模块'enum'没有属性'IntFlag'

AttributeError: module 'serial' has no attribute 'Serial'