2

I recently updated my numpy to version 1.19.4 and my scipy to 1.5.4 when installing another new module.

I'm now getting an error message which says:

from numpy.testing.decorators import slow #noqa
>>> ModuleNotFoundError: No module named 'numpy.testing.decorators'

I'm not sure how to fix this. Would it have anything to do with the update?

I'm using Spyder in Anaconda

sophros
  • 14,672
  • 11
  • 46
  • 75
runrabbit
  • 23
  • 3
  • 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

For numpy version 1.19.4 decorators is now under ._private

from numpy.testing._private.decorators import slow

should work

Miguel Trejo
  • 5,913
  • 5
  • 24
  • 49
0

If you get this error in a read-only library file, you should update the library version.

For example, if you fail on from numpy.testing.decorators import slow in lib/python3.6/dist-packages/pandas/util/testing.py - you should update pandas version:

pip3 install -U pandas
STF
  • 1,485
  • 3
  • 19
  • 36