AttributeError: module 'numpy' has no attribute 'int'. `怎么解决
时间: 2023-10-01 16:03:53 浏览: 262
问题解决:AttributeError: module ‘paddle.fluid’ has no attribute ‘EndStepEvent’
5星 · 资源好评率100%
要解决`AttributeError: module 'numpy' has no attribute 'int'`错误,您可以尝试以下两种解决方案:
解决方案一:
1. 使用命令卸载当前的numpy版本:
```
pip uninstall numpy
```
2. 安装1.22版本的numpy:
```
pip install numpy==1.22
```
解决方案二:
1. 使用命令卸载当前的numpy版本:
```
pip uninstall numpy
```
2. 打开您的代码文件,找到相关的代码行,将`numpy.int`替换为`int`。
这两种解决方案都是为了解决由于numpy版本更新所导致的`AttributeError: module 'numpy' has no attribute 'int'`错误。您可以选择其中一种方法来解决问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [AttributeError: module 'tensorflow.compat.v1' has no attribute '](https://download.csdn.net/download/qq_38766019/86272235)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [AttributeError: module numpy has no attribute int. 报错解决方案](https://blog.csdn.net/qq_42732229/article/details/130429209)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [AttributeError: module numpy has no attribute int .报错解决方案](https://blog.csdn.net/weixin_46669612/article/details/129624331)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文