0

I'm having troubles importing pandas:

import pandas

--- 

In [7]: import pandas

Traceback (most recent call last):

File "<ipython-input-7-d6ac987968b6>", line 1, in <module>
import pandas

File "//anaconda/lib/python3.6/site-    packages/pandas/__init__.py", line 56, in <module>
import pandas.util.testing

 File "//anaconda/lib/python3.6/site-  packages/pandas/util/testing.py", line 22, in <module>
from numpy.testing.decorators import slow     # noqa

ModuleNotFoundError: No module named 'numpy.testing.decorators'    

I recently fully reinstalled anaconda with home-brew; moreover, I installed the following:

  • pip install numpy==1.18
  • pip install scipy==1.1.0
  • pip install scikit-learn==0.21.3
  • pip install pandas

The pandas version I'm using is 0.25.1

Does anyone have an idea of what might be going wrong?

Elisa Macchi
  • 33
  • 1
  • 7
  • Looks like your pandas and numpy versions are not compatible – Ivan Feb 05 '20 at 08:49
  • Does this answer your question? [ModuleNotFoundError: No module named 'numpy.testing.nosetester'](https://stackoverflow.com/questions/59474533/modulenotfounderror-no-module-named-numpy-testing-nosetester) – sophros Apr 29 '21 at 17:25

2 Answers2

0

Upgrade to pandas 1.0.0 (If you have no other reason not to) via,

pip install -U pandas

See if it helps.

Redowan Delowar
  • 1,580
  • 1
  • 14
  • 36
  • 1
    Usually, this happens due to NumPy version conflicts. Try to remove your current environment, create a new python environment and then install pandas first. This should install the sub dependencies correctly. – Redowan Delowar Feb 05 '20 at 09:25
0
pip uninstall numpy
pip install numpy==1.17.0
Max Kleiner
  • 1,442
  • 1
  • 13
  • 14
  • 1
    This appears to be an identical answer to [another answer](https://stackoverflow.com/a/74510836/12567365) you recently provided. That may mean that the questions are duplicates - and therefore one question should be flagged as such. If the problems in the questions are not duplicates, then maybe you can differentiate your two answers? – andrewJames Nov 20 '22 at 18:38