Install & Compatibility
Where this runs
tested against v2.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.268s · 90MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.6s · import 0.290s · 86MB
90MB installed
● package 90MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
as_strict_package
✓ import array_api_strict as xp
✗ import array_api_strict as xp; from array_api_strict import arange
Most users treat the package as a namespace (like numpy), not importing individual functions.
create_array
✓ import array_api_strict as xp; a = xp.asarray([1,2,3])
✗ from array_api_strict import array
The 'array' function is not directly exported; use 'asarray' instead.
linalg
✓ from array_api_strict.linalg import ...
✗ from array_api_strict import linalg
Submodules like 'linalg' are not part of the top-level namespace; must be imported explicitly.
Create two 1-D arrays and compute their dot product using the array API standard functions.
import array_api_strict as xp
def main():
a = xp.asarray([1, 2, 3])
b = xp.asarray([4, 5, 6])
c = xp.dot(a, b)
print(c)
if __name__ == '__main__':
main()
Errors
Common errors & fixes
AttributeError: module 'array_api_strict' has no attribute 'array'
array_api_strict does not export a function called 'array'; use 'asarray' instead.
fixReplace xp.array(...) with xp.asarray(...).
ValueError: Data type casting violation
Mixed dtype operation that violates strict casting rules.
fixExplicitly convert inputs to the same dtype: xp.asarray(a, dtype=xp.float64) + b.
AttributeError: module 'array_api_strict' has no attribute 'linalg'
Linear algebra submodule is not in top-level namespace; must be imported.
fixAdd 'from array_api_strict.linalg import ...' before using linalg functions.
Upgrade
Version history
2.5latest on PyPI · released Feb 23, 2026
Audit
Dependencies
No dependency data recorded yet.