我将 numpy 升级到最新版本,现在我在导入 numpy 时遇到以下错误:
AttributeError: type object 'numpy.ndarray' has no attribute 'array_function'
我使用的是 numpy 1.16 版。
最佳答案
卸载所有安装的 Numpy 使用
pip uninstall numpy
对于 python3
pip3 uninstall numpy
您可能需要多次运行卸载命令,因为可能会安装多个版本的 numpy。然后运行
pip install numpy
关于python - 属性错误 : type object 'numpy.ndarray' has no attribute '__array_function__' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54176610/