numpy 报错:”AttributeError: module ‘numpy‘ has no attribute ‘bool‘“

简介: numpy 报错:”AttributeError: module ‘numpy‘ has no attribute ‘bool‘“

问题描述


跑代码(pyCUDA,pyTensorRT相关)的时候numpy报错


File ~\anaconda3\envs\myenv\lib\site-packages\numpy_init_.py:284, in getattr(attr)

281 from .testing import Tester

282 return Tester

–> 284 raise AttributeError("module {!r} has no attribute "

285 “{!r}”.format(name, attr))

AttributeError: module ‘numpy’ has no attribute ‘bool’

解决方案


把numpy从1.22.x升级到1.23.1


python -m pip uninstall numpy
python -m pip install numpy==1.23.1


决方案来源

https://stackoverflow.com/questions/74893742/how-to-solve-attributeerror-module-numpy-has-no-attribute-bool


213c71d1794f466aa9f398922d6bdfb1.png

目录
打赏
0
0
0
0
691
分享
相关文章
AttributeError: module ‘numpy‘ has no attribute ‘array‘解决办法
AttributeError: module ‘numpy‘ has no attribute ‘array‘解决办法
898 0
【错误记录】Mac 中 Python 报错 ( ERROR: Could not build wheels for numpy which use PEP 517 | 问题未解决 | 问题记录 )(一)
【错误记录】Mac 中 Python 报错 ( ERROR: Could not build wheels for numpy which use PEP 517 | 问题未解决 | 问题记录 )(一)
2024 0
【错误记录】Mac 中 Python 报错 ( ERROR: Could not build wheels for numpy which use PEP 517 | 问题未解决 | 问题记录 )(一)
|
6月前
|
module 'numpy' has no attribute 'int'.
module 'numpy' has no attribute 'int'.
201 0
人工智能平台PAI操作报错合集之交互式建模(DSW)环境中,numpy模块如何正确安装
阿里云人工智能平台PAI (Platform for Artificial Intelligence) 是阿里云推出的一套全面、易用的机器学习和深度学习平台,旨在帮助企业、开发者和数据科学家快速构建、训练、部署和管理人工智能模型。在使用阿里云人工智能平台PAI进行操作时,可能会遇到各种类型的错误。以下列举了一些常见的报错情况及其可能的原因和解决方法。
|
9月前
|
AttributeError: module ‘numpy‘ has no attribute ‘int‘.
AttributeError: module ‘numpy‘ has no attribute ‘int‘.
270 0
|
9月前
|
AttributeError: module ‘numpy‘ has no attribute ‘int‘.
AttributeError: module ‘numpy‘ has no attribute ‘int‘.
209 0
numpy库报错has no attribute ‘_no_nep50_warning‘的解决
numpy库报错has no attribute ‘_no_nep50_warning‘的解决
167 1
代码import torch 报错 ImportError: numpy.core.multiarray failed to import
代码import torch 报错 ImportError: numpy.core.multiarray failed to import
602 0
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等