原因:np.int 在 NumPy 1.20 中已弃用,在 NumPy 1.24 中已删除

AttributeError: module 'numpy' has no attribute 'int'.
`np.int` was a deprecated alias for the builtin `int`. To avoid this error in existing code, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:

解决方案

将np.int更改为np.int_

https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations



点击出现错误代码链接会自动跳转到相应numpy.int的位置



再次运行

module 'numpy' has no attribute 'int'.的更多相关文章

  1. 【Python 数据分析】module 'numpy' has no attribute 'array'

    安装好Numpy模块后,开始做了几个小测试都可以运行,但是当我创建numpy.py这个文件后 numpy.py import numpy y = numpy.array([[11,4,2],[2,6, ...

  2. AttributeError: module 'numpy' has no attribute 'num'

    AttributeError: module 'numpy' has no attribute 'num' 写在前面 总的来说,先看看自己用的计算方式是不是写对了先,多个一起使用的话记得都看看 通过想 ...

  3. AttributeError: 'module' object has no attribute 'TornadoAsyncNotifier'

    /*************************************************************************** * AttributeError: 'modu ...

  4. Python基础学习-'module' object has no attribute 'urlopen'解决方法

    import numpy as npimport urlliburl = "http://archive.ics.uci.edu/ml/machine-learning-databases/ ...

  5. 解决:pipenv shell报错:AttributeError: 'module' object has no attribute 'run'

    利用pipenv shell切换到虚拟环境时,显示报错:AttributeError: 'module' object has no attribute 'run' 可以看到是d:\program\p ...

  6. 解决Pycharm中matplotlib画图出错问题(AttributeError: module 'matplotlib' has no attribute 'verbose')

    最近在Linux中使用pycharm过程中使用matplotlib无法画图,总是提示错误 /usr/bin/python3. /home/leo/PycharmProjects/untitled1/E ...

  7. module 'cv2' has no attribute 'KNearest_create'

    python版本:3.6.5 opencv版本:3.2.0 使用的是jupyter notebook 源代码如下: import cv2 import numpy as np import matpl ...

  8. python中引入包的时候报错AttributeError: module 'sys' has no attribute 'setdefaultencoding'解决方法?

    python中引入包的时候报错:import unittestimport smtplibimport timeimport osimport sysimp.reload(sys)sys.setdef ...

  9. Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法

    最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...

  10. attributeError:'module' object has no attribute ** 解决办法

    写了一个小脚本,执行的时候报错: Traceback (most recent call last): File "F:/test/qrcode.py", line 109, in ...

随机推荐

  1. Asp.Net Core webapi+net6 使用资源筛选器(过滤器) 做缓存

    写一个特性类,用来做标记 [AttributeUsage(AttributeTargets.Method)] //只对方法有效 public class ResourceFilterAttribute ...

  2. Redis Functions 介绍之一

    Redis提供了编程接口(programming interface)可以让你在Redis服务器端执行客户的脚本. 一个重大的变化就是从Redis 7开始,你可以选择使用Redis Functions ...

  3. 解决报错Invalid bound statement (not found)

    解决报错Invalid bound statement (not found) 问题描述: 在玩mybatis-plus的时候,在测试类写了一个测试批量插入的方法,结果就报错: 它的意思是 无效的跳转 ...

  4. easy_enc

    寻找main函数,步过好像没有main函数,这时候想要F5就只能找到对的函数了 F5以后发现进行的操作有很多,这里发现有几个都没用的 后面发现主要是对V5有操作,所以直接看有关于V5的操作函数 经过上 ...

  5. Johnson 最短路算法

    Johnson 算法 全源最短路径求解其实是单源最短路径的推广,求解单源最短路径的两种算法时间复杂度分别为: Dijkstra 单源最短路径算法:时间复杂度为 \(O(E + VlogV)\),要求权 ...

  6. js实现按照首字母排序

    <script type="text/javascript"> let obj = [{name:'CA'},{name:'XA'},{name:'CB'},{name ...

  7. pta三次实验的总结

    第一次pta作业 在pta第一次作业,因为是第一次作业所以大体是比较容易,但是也有几个要注意的点,就是两个double的值相加减相乘的值与实际值会有一定的误差,误差大小为0.0000001,所以在写p ...

  8. [scrapy]一个简单的scrapy爬虫demo

    一个简单的scrapy爬虫demo 爬取豆瓣top250的电影名称+电影口号 使用到持久化流程: 爬虫文件爬取到数据后,需要将数据封装到items对象中. 使用yield关键字将items对象提交给p ...

  9. [CF1168C] And Reachability

    And Reachability 题面翻译 题目描述 Toad Pimple 有一个整数数组 \(a_1,\dots,a_n\). 当 \(x < y\) 且存在 \(x = p_1 < ...

  10. windows查看GPU信息(nvidia-smi)

    一般在使用windows系统的电脑时,想要了解GPU的使用情况时,我们通常会打开任务管理器去查看.但是这种方式一般只能看到简单的情况.那么我们想要了解更多的情况的话,该怎么办呢.可以在cmd中输入nv ...