Install & Compatibility
Where this runs
tested against v1.6.3 · 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
build_error
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 11.7s · import 1.964s · 585MB
606MB installed
● package 606MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
jdc
✓ import jax_dataclasses as jdc
✗ from jax_dataclasses import jdc
jdc is the module alias, not a submodule. Using 'from ... import jdc' will raise ImportError.
jdc.jit
✓ import jax_dataclasses as jdc; @jdc.jit
✗ from jax_dataclasses import jit
jit is an attribute of the module, not importable directly. Use jdc.jit.
Static
✓ from jax_dataclasses import Static
Creates a simple pytree dataclass and demonstrates functional mutation via jdc.replace.
import jax
import jax_dataclasses as jdc
@jdc.pytree_dataclass
class MyModel:
a: jax.Array
b: jax.Array
model = MyModel(a=jax.numpy.array(1.0), b=jax.numpy.array(2.0))
# Functional update
new_model = jdc.replace(model, a=jax.numpy.array(3.0))
print(new_model.a, new_model.b) # 3.0, 2.0
Errors
Common errors & fixes
AttributeError: module 'jax_dataclasses' has no attribute 'jdc'
Attempting to import jdc as a submodule: from jax_dataclasses import jdc
fixUse import jax_dataclasses as jdc
TypeError: replace() got an unexpected keyword argument 'a'
Using jdc.replace on a class not decorated with @jdc.pytree_dataclass (maybe used standard dataclass).
fixEnsure the class is decorated with @jdc.pytree_dataclass.
Upgrade
Version history
1.6.3latest on PyPI · released Dec 19, 2025
Audit
Dependencies
jaxrequiredRequired for pytree registration and JIT compilation.
chexoptionalUsed for testing; optional for runtime.