python - 属性错误 : type object 'numpy.ndarray' has no attribute '__array_function__'

标签 python python-3.x numpy

我将 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/

相关文章:

python - Pandas : saving Series of dictionaries to disk

Python 段错误?

python - 如何使用 jinja 模板引擎将数组转换为字符串?

python dict.add_by_value(dict_2)?

Python 3 不适用于 Sublime Text 2

python - Python 3 和 Python 2 之间 type() 和 hasattr() 的区别

python - 在Python中解析包含反斜杠的字符串以列出

python - 将 PIL 图像保存到 4D Numpy 数组时显示的静态图像

python:numpy.where 出错

python - Numpy.minimum 与 Pandas.Series 时间戳类型错误 : Cannot compare 'Timestamp' with 'int'