[已解决]AttributeError: module ‘numpy‘ has no attribute ‘float‘

1、问题: AttributeError: module 'numpy' has no attribute 'float'

`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.

The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

2、解决方法[参考](https://blog.csdn.net/qq_51511878/article/details/129811061 "参考")

conda list

降低numpy 版本:

python 复制代码
pip uninstall numpy
pip install numpy==1.23.5
相关推荐
郝学胜-神的一滴3 天前
Effective STL 条款12:对容器线程安全性的现实期望
c语言·开发语言·c++·qt·网络协议·rpc·numpy
郝学胜-神的一滴5 天前
Effective Python 条款41:试Mix‑In组合式开发
开发语言·pytorch·python·pycharm·numpy
2601_967987377 天前
使用 NumPy 和 Python 实现梯度下降
python·机器学习·线性回归·numpy·梯度下降
郝学胜-神的一滴10 天前
Effective Python 条款36:优雅拼装迭代器与生成器
开发语言·数据结构·人工智能·python·numpy·scikit-learn
2601_9679791212 天前
简单学Python——NumPy库6——数值计算1——累加和累乘
数值计算·numpy·数组·累加·累乘
LiaoWL12312 天前
从零搭一个 RAG 知识库(二):换上语义 Embedding——BGE 实测与阈值重校准
python·大模型·numpy·embedding·向量检索·rag
LiaoWL12315 天前
NumPy 入门实战(二):向量化与余弦相似度——从 ndarray 到 Embedding
python·numpy·embedding
郝学胜-神的一滴17 天前
LangChain Skill 实现(渐进披露 On-Demand Skill,LangChain 官方 Deep Agent Skill 模式)
开发语言·python·langchain·numpy
2601_9679801121 天前
Python中flatten( )函数及函数用法详解
python·numpy·数组操作·flatten函数·列表处理
郝学胜-神的一滴22 天前
AI 编程智能体 27:吃透MCP通信机制
人工智能·python·langchain·wpf·numpy·scikit-learn