原因: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. Vue项目引用百度地图并实现搜索定位等功能

    Tip:本篇文章为案例分析,技术点较多,所以篇幅较长,认真阅览的你一定会学到很多知识. 前言:百度地图开放平台 给开发者们提供了丰富的地图功能与服务,使我们的项目中可以轻松地实现地图定位.地址搜索.路 ...

  2. 文心一言 VS 讯飞星火 VS chatgpt (145)-- 算法导论12.1 5题

    五.用go语言,因为在基于比较的排序模型中,完成n个元素的排序,其最坏情况下需要 Ω(nlgn) 时间.试证明:任何基于比较的算法从 n 个元素的任意序列中构造一棵二又搜索树,其最坏情况下需要 Ω(n ...

  3. 百度API学习 | day01

    大作业:(2023.12.27日完成) 各位同学可根据自身情况进行选择: 选项一:根据实验一.二.三完成如下任务: 任务一:基于Jfinal构建信息管理系统,要求包含用户管理,翻译业务模块管理,图片优 ...

  4. 汇报工作与众不同:在PPT中展示Datainside动态图表

    题目要求了解在PPT中展示Datainside动态图表,下面是关于该主题的详细介绍. 内容可视化:概念与定义 内容可视化(Data Visualization)是将数据以图形或其他视觉形式呈现的过程, ...

  5. [CF1788F] XOR, Tree, and Queries

    题目描述 You are given a tree of $ n $ vertices. The vertices are numbered from $ 1 $ to $ n $ . You wil ...

  6. .net 温故知新【16】:Asp.Net Core WebAPI 筛选器

    一.筛选器 通过使用筛选器可在请求处理管道中的特定阶段之前或之后运行代码. 这即是我们经常听到的面向切面编程AOP(Aspect Oriented Programming)技术,AOP通过预编译方式和 ...

  7. 从 ECMAScript 6 角度谈谈执行上下文

    大家好,我是归思君 起因是最近了解JS执行上下文的时候,发现很多书籍和资料,包括<JavaScript高级程序设计>.<JavaScript权威指南>和网上的一些博客专栏,都是 ...

  8. X2加密的PcbDoc类型导出内容有误,不加密的PcbDoc导出的表格正常

    出现该类问题说明读取PcbDoc文件文件出了文件,加密类型添加tmp类型即可

  9. 华企盾DSC防泄密:PTC Creo程序打开加密文件报错

    SolidDesigner.exe(PTC Creo)程序打开加密文件报错,添加的进程不对,任务管理器查看详细信息即可找到进程

  10. 【docker】docker中装Redis集群

    一.搭建步骤 1.启动容器 #关闭防火墙 systemctl start docker 2.新建6个docker容器redis实例 docker run -d --name redis-node-1 ...