Search code examples
pythonnumpyimporterror

Python: No module named numpy.testing.decorators for numpy 1.19.4


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


Solution

  • For numpy version 1.19.4 decorators is now under ._private

    from numpy.testing._private.decorators import slow
    

    should work