{"library":"oldest-supported-numpy","title":"Oldest Supported NumPy","description":"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.","language":"python","status":"active","last_verified":"Thu Apr 09","install":{"commands":["pip install oldest-supported-numpy"],"cli":null},"imports":[],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import subprocess\nimport sys\n\n# Install oldest-supported-numpy, which in turn installs a specific numpy version\n# This example assumes pip is installed and available\n# In a real environment, you'd typically do 'pip install oldest-supported-numpy' once.\n# For this quickstart, we ensure numpy is uninstalled first to demonstrate the effect.\n\ntry:\n    # Uninstall numpy if present to ensure oldest-supported-numpy picks it up\n    subprocess.run([sys.executable, '-m', 'pip', 'uninstall', '-y', 'numpy'], check=True, capture_output=True)\nexcept subprocess.CalledProcessError as e:\n    # This is expected if numpy isn't installed initially\n    pass # print(f\"Uninstall failed (expected if not present): {e.stderr.decode().strip()}\")\n\n# Install oldest-supported-numpy, which will pull in a specific numpy version\nsubprocess.run([sys.executable, '-m', 'pip', 'install', 'oldest-supported-numpy'], check=True, capture_output=True)\n\n# Now, import numpy and check its version\nimport numpy as np\n\nprint(f\"NumPy version installed by oldest-supported-numpy: {np.__version__}\")\n\n# Basic NumPy usage\na = np.array([1, 2, 3])\nb = np.array([4, 5, 6])\nc = a + b\nprint(f\"Example NumPy array operation: {c}\")\n","lang":"python","description":"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.","tag":null,"tag_description":null,"last_tested":"2026-04-24","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":0}]},"compatibility":null}