numpy报错AttributeError: module ‘numpy‘ has no attribute ‘float‘.

  • 报错:

AttributeError: module ‘numpy’ has no attribute ‘float’.

  • 原因:

numpy版本过高

  • 解决:
pip uninstall numpy
pip install numpy==1.23.5

出现问题:
ERROR: Cannot uninstall numpy 1.24.3, RECORD file not found. You might be able to recover from this via: ‘pip install --force-reinstall --no-deps numpy==1.24.3’.
解决:
进入anaconda3/envs/pytorch/lib/python3.8/site-packages
删除numpy-1.24.3.dist-info文件夹
重新执行:pip install numpy==1.23.5

你可能感兴趣的:(numpy,python,深度学习)