熊猫导入错误:模块'瓶颈'没有属性' __版本__'

时间:2018-02-25 02:18:44

标签: python pandas packages

我一直在使用pandas,tensorflow几个月,但突然间我今天无法导入它们。 当我尝试:

import pandas as pd

它会显示:

File "<input>", line 1, in <module>
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.2.4\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
  module = self._system_import(name, *args, **kwargs)
File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas\__init__.py", line 42, in <module>
  from pandas.core.api import *
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.2.4\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
  module = self._system_import(name, *args, **kwargs)
File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas\core\api.py", line 9, in <module>
  from pandas.core.categorical import Categorical
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.2.4\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
  module = self._system_import(name, *args, **kwargs)
File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas\core\categorical.py", line 36, in <module>
  from pandas.core.base import (PandasObject,
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.2.4\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
  module = self._system_import(name, *args, **kwargs)
File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas\core\base.py", line 20, in <module>
  import pandas.core.nanops as nanops
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.2.4\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
  module = self._system_import(name, *args, **kwargs)
File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas\core\nanops.py", line 30, in <module>
  ver = bn.__version__
AttributeError: module 'bottleneck' has no attribute '__version__'

我可以知道我能做什么吗?我已经安装了Bottleneck,但似乎仍然出现错误。

4 个答案:

答案 0 :(得分:0)

我遇到了同样的问题。 我真的不知道这意味着什么,但是似乎在模块“瓶颈”中一定有问题。 然后我通过:

解决了
  

conda消除瓶颈

     

conda安装瓶颈

是的,只需重新安装瓶颈,我的问题就解决了。 希望对您有帮助。

答案 1 :(得分:0)

我通过(重新)安装[conda|pip] install Bottleneck

解决了该问题

答案 2 :(得分:0)

我遇到了同样的问题,通过升级瓶颈然后升级了熊猫来解决了这个问题:

pip install --upgrade bottleneck
pip install --upgrade pandas

答案 3 :(得分:-1)

为解决此问题,我执行了以下操作:

  • 未安装的熊猫
  • 未安装的瓶颈
  • 已执行conda install bottleneck