Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pandas import error: module 'bottleneck' has no attribute '__version__'

I have been using pandas, tensorflow for a few months, but suddenly today I cannot import them. When I try to:

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.

like image 998
Hyoceansun Avatar asked Mar 07 '23 19:03

Hyoceansun


2 Answers

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

Yes, simply reinstall bottleneck, my problem has been solved. Hope this could help you.

like image 64
Eric Liu Avatar answered Mar 13 '23 17:03

Eric Liu


I had the same issue, resolved it by upgrading bottleneck then pandas:

pip install --upgrade bottleneck
pip install --upgrade pandas
like image 26
SeaSnail Avatar answered Mar 13 '23 17:03

SeaSnail