np.float_ Has Been Removed from NumPy Data Types

Symptom

The following error message is displayed during operator generation:

Failed to import Python module [AttributeError: `np.float_` was removed in the NumPy 2.0 release. Use `np.float64` instead.].

Possible Cause

By default, NumPy 2.0 is installed for Python 3.9 and later versions. However, CANN does not adapt to NumPy 2.0.

Solution

Change the NumPy version to 1.26.

1
pip3 install numpy==1.26