AttributeError:类型对象"numpy.ndarray"没有属性"__array_function__" [英] AttributeError: type object 'numpy.ndarray' has no attribute '__array_function__'

查看:800
本文介绍了AttributeError:类型对象"numpy.ndarray"没有属性"__array_function__"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将numpy升级到最新版本,现在在导入numpy时遇到以下错误:

I upgraded numpy to the latest version and now I am getting following error on importing numpy:

AttributeError:类型对象'numpy.ndarray'没有属性 ' array_function '

AttributeError: type object 'numpy.ndarray' has no attribute 'array_function'

我正在使用numpy版本1.16.

I am using numpy version 1.16.

推荐答案

使用卸载所有安装的Numpy

Uninstall all installs of Numpy using

pip uninstall numpy

对于python3

pip3 uninstall numpy

由于可能安装了多个版本的numpy,因此您可能需要多次运行uninstall命令.然后运行

You may need to run the uninstall command several times since several versions of numpy may be installed. Then run

pip install numpy

这篇关于AttributeError:类型对象"numpy.ndarray"没有属性"__array_function__"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆