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

目录
相关文章
|
数据处理 Python
AttributeError: module ‘numpy‘ has no attribute ‘array‘解决办法
AttributeError: module ‘numpy‘ has no attribute ‘array‘解决办法
714 0
成功解决AttributeError: module 'numpy' has no attribute 'integer'
成功解决AttributeError: module 'numpy' has no attribute 'integer'
成功解决AttributeError: module 'numpy' has no attribute 'integer'
|
TensorFlow 算法框架/工具 Python
成功解决AttributeError: module 'numpy' has no attribute 'equal'
成功解决AttributeError: module 'numpy' has no attribute 'equal'
成功解决AttributeError: module 'numpy' has no attribute 'equal'
|
Python Windows
【错误记录】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 | 问题未解决 | 问题记录 )(一)
1876 0
【错误记录】Mac 中 Python 报错 ( ERROR: Could not build wheels for numpy which use PEP 517 | 问题未解决 | 问题记录 )(一)
|
2月前
|
Python
module 'numpy' has no attribute 'int'.
module 'numpy' has no attribute 'int'.
76 0
|
4月前
|
机器学习/深度学习 人工智能 IDE
人工智能平台PAI操作报错合集之交互式建模(DSW)环境中,numpy模块如何正确安装
阿里云人工智能平台PAI (Platform for Artificial Intelligence) 是阿里云推出的一套全面、易用的机器学习和深度学习平台,旨在帮助企业、开发者和数据科学家快速构建、训练、部署和管理人工智能模型。在使用阿里云人工智能平台PAI进行操作时,可能会遇到各种类型的错误。以下列举了一些常见的报错情况及其可能的原因和解决方法。
|
5月前
|
Python
AttributeError: module ‘numpy‘ has no attribute ‘int‘.
AttributeError: module ‘numpy‘ has no attribute ‘int‘.
70 0
|
5月前
|
Python
AttributeError: module ‘numpy‘ has no attribute ‘int‘.
AttributeError: module ‘numpy‘ has no attribute ‘int‘.
95 0
|
5月前
|
Ubuntu 定位技术 Python
numpy库报错has no attribute ‘_no_nep50_warning‘的解决
numpy库报错has no attribute ‘_no_nep50_warning‘的解决
112 1
|
PyTorch 算法框架/工具 Python
代码import torch 报错 ImportError: numpy.core.multiarray failed to import
代码import torch 报错 ImportError: numpy.core.multiarray failed to import
426 0
下一篇
无影云桌面