TypeError: Cannot interpret '<attribute 'dtype' of 'numpy.generic' objects>' as a data type 解决方案

TypeError: 无法将 ‘numpy.generic’ objects>’ 的 '<attribute ‘dtype’ 解释为数据类型

这个问题是由numpy版本引起的。

最开始我在网上查到的解决方案是说numpy版本过低,升级就好,但是升级的时候发现我已经是最新版本了,1.21.0

然后看到帖子说pandas也有影响,然后就把pandas也升级,并且重启就好了。

pip install -U numpy
pip install -U pandas

版本问题最好还是查官方文档解决

原文地址:https://www.cnblogs.com/LLLLgR/p/15023261.html