AttributeError: module 'numpy' has no attribute 'object'
  TnD0WQEygW8e 2023年11月02日 55 0
AttributeError: module 'numpy' has no attribute 'object'

AttributeError: module

 

 

AttributeError: module

 

 

解决方案:

pip uninstall numpy

pip install numpy==1.23.4

 =============================================

Since version 1.24 of numpy, np.object is deprecated, and needs to be replaced with object (cf. numpy release notes).

You either need to update this in your code, or another package you're using needs to be updated (not possible to answer without more information).

One (dirty) workaround for now would be to fix your numpy version to the last version still supporting np.object with pip install numpy==1.23.4

=============================================

The Python "AttributeError module 'numpy' has no attribute 'object'" occurs when we have a local file named numpy.py and try to import it from the numpy module. To solve the error, make sure to rename any local files named numpy.py . Another way: Check that the file you are running was named numpy.py

=============================================

  • Solution 1: pip install --upgrade numpy
  • Solution 2: Re-install numpy
pip uninstall numpy
  pip install numpy
  • Solution 3 (if you are using conda package manager): conda update numpy

=============================================

 

 

 

https://stackoverflow.com/questions/75069062/module-numpy-has-no-attribute-object#:~:text=The%20Python%20%22AttributeError%20module%20'numpy,running%20was%20named%20numpy.py%20.

 



【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

推荐阅读
TnD0WQEygW8e