numpy alias removed Python Origin: Application & API Last updated 13 Oct 2026

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

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

Exact message you may see module 'numpy' has no attribute 'float'module 'numpy' has no attribute 'int'has no attribute 'NaN'
Seen on: Python

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__

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

0xC1900101 — Windows upgrade error 0xC1900101 (driver error, rolled back) (Windows)0xC1900101AttributeError — AttributeError: 'X' object has no attribute 'y' (Python)AttributeErrorbroadcast error — ValueError: operands could not be broadcast together with shapes (3,) (4,) (Python)broadcast errorcaching_sha2_password — Authentication plugin 'caching_sha2_password' cannot be loaded (MySQL)caching_sha2_passwordcb() never called — npm ERR! cb() never called! (npm)cb() never calledcookies() should be awaited — Next.js 15: Route "/x" used `cookies().get('token')`. `cookies()` should be awaited before using its value (Next.js)cookies() should be a…Corepack keyid — Error: Cannot find matching keyid (Corepack signature verification) (npm)Corepack keyidGLIBC_2.xx not found — /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (Linux)GLIBC_2.xx not foundnumpy ali…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.