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

目录
相关文章
|
8月前
|
数据处理 Python
AttributeError: module ‘numpy‘ has no attribute ‘array‘解决办法
AttributeError: module ‘numpy‘ has no attribute ‘array‘解决办法
451 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'
|
16小时前
|
Python
AttributeError: module ‘numpy‘ has no attribute ‘int‘.
AttributeError: module ‘numpy‘ has no attribute ‘int‘.
5 0
|
16小时前
|
Python
AttributeError: module ‘numpy‘ has no attribute ‘int‘.
AttributeError: module ‘numpy‘ has no attribute ‘int‘.
6 0
|
16小时前
|
Ubuntu 定位技术 Python
numpy库报错has no attribute ‘_no_nep50_warning‘的解决
numpy库报错has no attribute ‘_no_nep50_warning‘的解决
|
PyTorch 算法框架/工具 Python
代码import torch 报错 ImportError: numpy.core.multiarray failed to import
代码import torch 报错 ImportError: numpy.core.multiarray failed to import
278 0
|
TensorFlow 算法框架/工具 计算机视觉
No module named ‘cv2‘ 解决办法 (No module named ‘numpy‘ 等所有报错均可解决)
No module named ‘cv2‘ 解决办法 (No module named ‘numpy‘ 等所有报错均可解决)
374 0
|
Python
rqalpha安装后使用报错:numpy.core.multiarray failed to import
rqalpha安装后使用报错:numpy.core.multiarray failed to import
66 0
|
Python
python3中报错No module named 'numpy'
python3中报错No module named 'numpy'
77 0