# AttributeError: module 'numpy' has no attribute 'float'

**Code:** `numpy alias removed` · **Category:** Python · **Seen on:** Python

Code uses np.float/np.int/np.bool/np.object, which were removed in NumPy 1.24.

## Meaning

These were aliases for Python built-ins, deprecated in 1.20 and removed in 1.24. Old code and old library versions break after upgrading NumPy.

## Common causes

- Your code uses np.float / np.int
- A dependency not updated for NumPy 1.24+
- NumPy 2.0 removed more aliases (np.NaN, np.Inf)

## Quick fix

1. Use built-ins (float, int, bool) or explicit types (np.float64, np.int64)
2. Upgrade the library that uses the alias
3. Pin numpy<1.24 temporarily

## Detailed fix by platform

### Python

1. `x = np.zeros(10, dtype=np.float64)`

## How to diagnose

1. **Origin** — Your code or a library?
2. **Version** — numpy.__version__

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/python/numpy-module-has-no-attribute-float)
