NumPy
Data & MLThe fundamental package for scientific computing with Python.
Release History
View all versions →v2.5.3Breaking19 fixesNumPy 2.5.3 is a patch release that fixes bugs discovered after the 2.5.2 release, with a focus on StringDType related issues and MaskedArray fill value handling.
v2.5.2Breaking22 fixes1 featureNumPy 2.5.2 is a patch release fixing bugs and including wheels for Python 3.15.0rc1. A notable C API change makes `PyArray_StringDTypeObject` opaque under the abi3t stable ABI.
v2.5.111 fixes1 featureNumPy 2.5.1 is a patch release fixing bugs, most notably resolving an issue with the datetime cython API, and raising the minimum required GCC version to 10.3.0.
v2.5.0Breaking6 featuresNumPy 2.5.0 is a transitional release that removes distutils support, expires many old deprecations, and introduces new deprecations related to array mutation and type handling. It also adds support for descending sorts and improves free threading.
v2.5.0rc1Breaking4 featuresNumPy 2.5.0 is a transitional release that removes distutils support, expires many older deprecations, and introduces new deprecations for unsafe array mutation methods. It also adds support for descending sorts and improves free threading.
v2.6.0.dev0v2.4.63 fixesNumPy 2.4.6 is a maintenance release fixing several regressions discovered in the 2.4.5 release, primarily affecting array conjugation and SVD calculations.
v2.4.511 fixes1 featureNumPy 2.4.5 is a patch release focused on bug fixes, typing improvements, and infrastructure maintenance. It resolves issues related to memory safety, type checking, and specific platform builds.
v2.4.43 fixesNumPy 2.4.4 is a patch release that resolves bugs, most notably fixing the OpenBLAS threading issue on ARM architectures.
v2.4.38 fixesNumPy 2.4.3 is a patch release primarily focused on bug fixes, including a significant threading fix for OpenBLAS on ARM.
v2.4.26 fixes1 featureNumPy 2.4.2 is a patch release focused on bug fixes, including resolving memory leaks and updating OpenBLAS to prevent hangs. It also adds minor feature enhancements like datetime string acceptance in arange.
v2.4.16 fixesNumPy 2.4.1 is a patch release that fixes several bugs discovered after the 2.4.0 release, including issues with iterators, string multiplication, and type handling in statistical functions.
v2.4.0Breaking4 featuresNumPy 2.4.0 introduces improvements for free threaded Python support, user dtypes, and annotations, alongside removing many long-deprecated APIs and finalizing prior deprecations.
v2.4.0rc1Breaking4 featuresNumPy 2.4.0 introduces annotation improvements, a new 'same_value' casting option, and several new APIs for user dtypes. This release also removes numerous long-deprecated features and enforces stricter behavior for scalar conversion.
v2.5.0.dev0This release begins the development cycle for NumPy 2.5. It includes initial setup files and updates to the build and release configuration.
v2.3.57 fixes1 featureNumPy 2.3.5 is a patch release containing maintenance updates and numerous bug fixes, including improvements to string slicing and handling of INT_MIN negation.
v2.3.410 fixesNumPy 2.3.4 is a patch release containing maintenance updates and numerous bug fixes, including changes to static library extensions on win-arm64 for MSVC compatibility.
v2.3.37 fixes2 featuresNumPy 2.3.3 is a patch release focused on maintenance updates and bug fixes across various areas, including linear algebra, type casting, and build system improvements. It introduces a new `sorted` argument for `np.unique`.
v2.3.29 fixes1 featureNumPy 2.3.2 is a patch release containing numerous bug fixes and maintenance updates, including support for Python 3.14.0rc1 wheels and updates to underlying libraries like PyPy and OpenBLAS.
v2.3.17 fixes1 featureNumPy 2.3.1 is a patch release containing several bug fixes, annotation improvements, and enhanced CPU feature detection support for OpenBSD and FreeBSD.
v2.3.06 featuresNumPy 2.3.0 introduces new features like string slicing and OpenMP support, alongside numerous expired deprecations being removed. This release focuses on improving free threaded Python support and code modernization.
v2.3.0rc16 featuresNumPy 2.3.0 improves free threaded Python support and annotations, introduces the new numpy.strings.slice function, and removes numerous long-expired deprecations. This release also modernizes code style and upgrades binary compatibility tags to manylinux_2_28.
v2.2.64 fixesNumPy 2.2.6 is a patch release focusing on bug fixes, particularly around string operations and type handling, alongside CI maintenance and typing improvements.
v2.2.510 fixesNumPy 2.2.5 is a patch release focused on fixing bugs discovered since 2.2.4, alongside significant typing improvements and CI maintenance.
v2.2.47 fixes1 featureNumPy 2.2.4 is a patch release focusing on bug fixes, platform maintenance, and significant typing improvements. It supports Python versions from 3.10 through 3.13.
Common Errors
ModuleNotFoundError3 reportsThe "ModuleNotFoundError" with numpy usually means numpy isn't installed or the current Python environment can't find it. Fix this by ensuring numpy is installed (`pip install numpy`) within the specific environment you're using (e.g., virtualenv, conda environment), and that the environment is activated before running your script. If using Pyinstaller, use a hook to ensure numpy is properly bundled with your executable.
RecursionError2 reportsRecursionError in NumPy arises when a function calls itself excessively without a proper base case to terminate the recursion, often triggered by deeply nested structures or flawed parsing logic. To fix it, identify the recursive function, ensure a well-defined base case that stops the recursion under specific conditions, and consider iterative approaches or increasing recursion depth limit with `sys.setrecursionlimit` as a last resort, if appropriate. Also, use try-except blocks to handle cases of malformed data.
SystemError2 reportsSystemError in NumPy often arises from incorrect type handling during operations like `astype` conversions or `np.dot` when the input array dtypes are fundamentally incompatible. To fix this, carefully examine the input array dtypes and use `astype` or other explicit conversion methods to ensure they are compatible before performing the operation. If the dtypes should work together, the library itself may have an issue so reporting to the numpy team could be useful.
ValueError2 reportsValueError in NumPy often arises from passing an argument of incorrect type or shape to a function (e.g., incompatible array dimensions or incorrect data type). Fix it by carefully inspecting the function's documentation for expected argument types and shapes, and ensure that the input data conforms to these requirements through type casting or reshaping if needed. Thoroughly test your code with various input scenarios, including edge cases like empty arrays, to catch such errors early.
FloatingPointError2 reportsFloatingPointError in NumPy often arises from operations like division by zero or taking the logarithm of a negative number. To fix it, carefully inspect your code for such operations and add checks to prevent them. For instance, use numpy.where to conditionally apply functions avoiding invalid inputs or add a small epsilon value to denominators to prevent division by zero.
SameFileError1 reportThe "SameFileError" in numpy compilation typically arises when the source and destination paths for file operations (like copying or linking) are identical. To fix this, carefully review the build scripts (e.g., `setup.py`, `meson.build`) or build system configuration and ensure that file operations avoid overwriting a file with itself by checking if source and destination paths are the same before proceeding, or use a temporary directory for intermediate files. Update the file paths to distinct directories or use specific flags that prevent operations on identical files within the compiler.
Related Data & ML Packages
An Open Source Machine Learning Framework for Everyone
🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.
Tensors and Dynamic neural networks in Python with strong GPU acceleration
scikit-learn: machine learning in Python
Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
Streamlit — A faster way to build and share data apps.
Subscribe to Updates
Get notified when new versions are released