Pandas 导入错误:模块“bottleneck”没有属性“__version__”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/48969627/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Pandas import error: module 'bottleneck' has no attribute '__version__'
提问by Hyoceansun
I have been using pandas, tensorflow for a few months, but suddenly today I cannot import them. When I try to:
我几个月来一直在使用 Pandas、tensorflow,但今天突然我无法导入它们。当我尝试:
import pandas as pd
It will show:
它会显示:
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__'
May I know what I can do? I have installed Bottleneck, but seems error still appears.
我可以知道我能做什么吗?我已经安装了瓶颈,但似乎仍然出现错误。
回答by Eric Liu
I got the same problem. I don't really know what it means, but it seems that something must be wrong in the module 'bottleneck'. Then I solved it by :
我遇到了同样的问题。我真的不知道这意味着什么,但似乎模块“瓶颈”中一定有问题。然后我通过以下方式解决了它:
conda remove bottleneck
conda install bottleneck
conda 消除瓶颈
conda 安装瓶颈
Yes, simply reinstall bottleneck, my problem has been solved. Hope this could help you.
是的,只需重新安装瓶颈,我的问题就解决了。希望这可以帮助你。
回答by CAtoOH
I solved it by (re)installing it [conda|pip] install Bottleneck
我通过(重新)安装解决了它 [conda|pip] install Bottleneck