首页 > 解决方案 > Python:没有用于 numpy 1.19.4 的名为 numpy.testing.decorators 的模块

问题描述

我最近在安装另一个新模块时将我的 numpy 更新到 1.19.4 版本,将我的 scipy 更新到 1.5.4。

我现在收到一条错误消息,上面写着:

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

我不知道如何解决这个问题。会不会跟更新有关系?

我在 Anaconda 中使用 Spyder

标签: pythonnumpyimporterror

解决方案


对于 numpy 版本1.19.4的装饰器现在在._private

from numpy.testing._private.decorators import slow

应该管用


推荐阅读