Registry / data / oldest-supported-numpy

oldest-supported-numpy

JSON →
library2023.12.21pypypiunverified

Oldest-supported-numpy is a meta-package that dynamically provides the oldest compatible NumPy version for a given Python interpreter and platform. It ensures that if a platform only gained support for NumPy wheels at a more recent version, that specific version is provided. The current version is 2023.12.21, and its release cadence is irregular, typically updated when new NumPy versions or platform support changes warrant it.

pip install oldest-supported-numpy
INSTALL
IMPORT
SIG · OLDEST-SUPPORTED-N
O
oldest-supported-numpy
datapythonv2023.12.21
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

This quickstart demonstrates how to install `oldest-supported-numpy` and then verifies which NumPy version was installed by importing it and checking `np.__version__`. It then shows a basic NumPy operation.

import subprocess import sys # Install oldest-supported-numpy, which in turn installs a specific numpy version # This example assumes pip is installed and available # In a real environment, you'd typically do 'pip install oldest-supported-numpy' once. # For this quickstart, we ensure numpy is uninstalled first to demonstrate the effect. try: # Uninstall numpy if present to ensure oldest-supported-numpy picks it up subprocess.run([sys.executable, '-m', 'pip', 'uninstall', '-y', 'numpy'], check=True, capture_output=True) except subprocess.CalledProcessError as e: # This is expected if numpy isn't installed initially pass # print(f"Uninstall failed (expected if not present): {e.stderr.decode().strip()}") # Install oldest-supported-numpy, which will pull in a specific numpy version subprocess.run([sys.executable, '-m', 'pip', 'install', 'oldest-supported-numpy'], check=True, capture_output=True) # Now, import numpy and check its version import numpy as np print(f"NumPy version installed by oldest-supported-numpy: {np.__version__}") # Basic NumPy usage a = np.array([1, 2, 3]) b = np.array([4, 5, 6]) c = a + b print(f"Example NumPy array operation: {c}")
Debug
Known issues
gotchaThe `oldest-supported-numpy` package itself does not have a Python API to import. Its sole purpose is to act as a dependency resolver, ensuring that a compatible (and often oldest-supported) version of the actual `numpy` package is installed into your environment.
fix
Do not attempt to `import oldest_supported_numpy`. Instead, once installed, `import numpy` to use the NumPy library.
affects: All versions
gotchaThe *specific* NumPy version installed by `oldest-supported-numpy` is dynamic. It depends on your Python interpreter version (`sys.version_info`) and the platform/architecture you are running on (e.g., Linux, macOS, Windows, ARM, x86-64). It prioritizes the oldest *available wheel* for your specific environment, not necessarily the absolute oldest NumPy release.
fix
Always check `numpy.__version__` after installation to confirm the exact version. If you require a *specific* NumPy version that is newer than what `oldest-supported-numpy` provides, you must explicitly pin `numpy==X.Y.Z` in your `requirements.txt` or `pyproject.toml`.
affects: All versions
gotchaUsing `oldest-supported-numpy` can lead to non-deterministic NumPy versions across different environments if those environments use varying Python versions. For example, Python 3.8 might get NumPy 1.20, while Python 3.9 might get NumPy 1.22.
fix
For highly reproducible builds where the NumPy version must be identical across all environments, explicitly pin `numpy==X.Y.Z` in your dependency list. Use `oldest-supported-numpy` primarily when you need to ensure basic compatibility across a range of older Python versions without manually finding the minimal NumPy for each.
affects: All versions
Errors
Common errors & fixes
ERROR Missing dependencies: oldest-supported-numpy
A project's build system (e.g., via `pyproject.toml`) declares `oldest-supported-numpy` as a dependency, but the build environment or package manager fails to correctly install this meta-package.
fix
Ensure `pip` or your package manager is correctly configured to install build dependencies. In some cases, for specific environments (e.g., custom Linux distributions or build systems), replacing the `oldest-supported-numpy` requirement with a specific `numpy` version constraint (e.g., `numpy >= 1.19.3`) in your project's `pyproject.toml` or `requirements.txt` might be necessary.
ERROR: No matching distribution found for oldest-supported-numpy
This error typically occurs when attempting to install `oldest-supported-numpy` or a package that depends on it using a Python version that is not supported by `oldest-supported-numpy` (e.g., Python 2.7, as `oldest-supported-numpy` requires Python >= 3.5).
fix
Upgrade your Python interpreter to a supported version (Python 3.5 or newer). If the problematic package only requires `numpy` and not specifically `oldest-supported-numpy`, consider removing `oldest-supported-numpy` from your project's dependencies and just specify a compatible `numpy` version directly.
RuntimeError: module compiled against API version 0x... but this version of numpy is 0x...
This indicates an ABI (Application Binary Interface) incompatibility. It means a Python package (like SciPy, scikit-learn, or spaCy) was compiled against one NumPy version (often an older one specified by `oldest-supported-numpy`), but at runtime, a different, incompatible NumPy version is present or was installed, leading to binary mismatch.
fix
Create a new virtual environment and reinstall all dependent packages, allowing `pip` to resolve and install compatible versions of NumPy and its dependents. For packages installed from source, ensure consistent NumPy versions are used both during compilation (often through build constraints) and at runtime.
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
Although `oldest-supported-numpy` is intended to manage NumPy dependencies, this `ModuleNotFoundError` suggests that NumPy itself is not correctly installed or accessible in the environment where a package attempts to import it, possibly due to build isolation issues or an incomplete installation process.
fix
Ensure NumPy is correctly installed and its path is accessible. If using a package that relies on `oldest-supported-numpy` for its build, try reinstalling the dependent package in a clean virtual environment to force a fresh resolution and installation of NumPy. Sometimes, explicitly running `pip install numpy` before installing the problematic package can help.
Upgrade
Version history
2023.12.21latest on PyPI · released Dec 21, 2023
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Resources
oldest-supported-numpy — pip install oldest-supported-numpy · libregistry