原因: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. Ansible自动化部署工具-组件及语法介绍

    大家好,我是蓝胖子,我认为自动化运维要做的事情就是把运维过程中的某些步骤流程化,代码化,这样在以后执行类似的操作的时候就可以解放双手了,让程序自动完成.避免出错,Ansible就是这方面非常好用的工具 ...

  2. Hibench对大数据平台CDH/HDP基准性能测试

    一.部署方式 1.1.源码/包:https://github.com/Intel-bigdata/HiBench 部署方法: https://github.com/Intel-bigdata/HiBe ...

  3. Mac postman调分页接口,导出csv

    准备后端接口 package com.ybchen.controller; import com.ybchen.utils.JsonData; import lombok.Data; import o ...

  4. Python根据输入的公司编号、名称、网址,格式化输出公司信息。其中1)冒号统一为英文冒号,编号占6位,不足6位的前面补0。编号后面是制表符。

    根据输入的公司编号.名称.网址,格式化输出公司信息.其中 1)冒号统一为英文冒号,编号占6位,不足6位的前面补0.编号后面是制表符. 2)"公司名称:" 后面输出字符串占8位,左对 ...

  5. CF1881C Perfect Square 题解

    思路 简单滴很,对于每一组 \((i,j)\) 找出其对应的三个点,减一减就完了. 对应的点是哪三个呢?显然是 \((n-i+1,n-j+1)\),\((j,n-i+1)\) 以及 \((i,n-j+ ...

  6. 自实现string类

    一. 环境 Linux x86_64,g++ 8.5.0 二. 实现 自实现 string 之前一直想写来着,一直拖着,现在把它完稿.这个版本是比较简单的版本,有一些可能有不同的或者更好的实现方式,后 ...

  7. GitHub Desktop安装与使用教程

    一.安装 1.下载 下载地址 2.安装 下载之后GitHub Desktop是没有安装步骤的,而是开始安装之后,稍等片刻就安装成功了. 然后登陆个人GitHub账号就可以进行一下操作了. 二.新建仓库 ...

  8. 机器人行业数据闭环实践:从对象存储到 JuiceFS

    JuiceFS 社区聚集了来自各行各业的前沿科技用户.本次分享的案例来源于刻行,一家商用服务机器人领域科技企业. 商用服务机器人指的是我们日常生活中常见的清洁机器人.送餐机器人.仓库机器人等.刻行采用 ...

  9. 欢迎 Mixtral - 当前 Hugging Face 上最先进的 MoE 模型

    最近,Mistral 发布了一个激动人心的大语言模型: Mixtral 8x7b,该模型把开放模型的性能带到了一个新高度,并在许多基准测试上表现优于 GPT-3.5.我们很高兴能够在 Hugging ...

  10. CentOS7部署后优化配置

    1.安装必要的组件.升级 yum -y install wget vim cd /etc/yum.repos.d/ rm -rf /etc/yum.repos.d/*.repo wget http:/ ...