Install & Compatibility
Where this runs
tested against v0.9.15 · 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
py 3.10
✕ build_error
✓ 2.28s
py 3.11
✕ build_error
✓ 2.43s
py 3.12
✕ build_error
✓ 2.35s
py 3.13
✕ build_error
✓ 2.43s
py 3.9
✕ build_error
✕ build_error
42MB installed
● package 42MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
SExp
✓ from clvm.SExp import SExp
Program
✓ from clvm.Program import Program
run_program
✓ from clvm.operators import run_program
assemble
✓ from clvm_tools.binutils import assemble
✗ from clvm import assemble
The 'assemble' function for compiling Chialisp is part of the 'clvm_tools' package, not 'clvm' itself. It needs to be installed separately.
This quickstart demonstrates how to compile a Chialisp program using `clvm_tools.binutils.assemble`, prepare arguments as `SExp` objects, and execute the program using `clvm.operators.run_program`. It also shows how to interpret the `SExp` result.
from clvm.SExp import SExp
from clvm.operators import run_program
from clvm_tools.binutils import assemble
# Define a simple Chialisp program: multiply an argument by 2
chialisp_code = '(mod (X) (* X 2))'
program = assemble(chialisp_code)
# Define arguments for the program as an SExp object (e.g., 5)
args = assemble('(5)') # Arguments must also be assembled or created as SExp
# Run the program
cost, result = run_program(program, args)
print(f"Chialisp program: {chialisp_code}")
print(f"Arguments: {args.as_python()}")
print(f"Execution Cost: {cost}")
print(f"Result: {result.as_int()}") # Convert the SExp result back to a Python int
# Example 2: Simple addition of two numbers provided as constants in the program
chialisp_code_add = '(+ 2 3)'
program_add = assemble(chialisp_code_add)
# For this program, no external arguments are needed
cost_add, result_add = run_program(program_add, assemble('()'))
print(f"\nChialisp program: {chialisp_code_add}")
print(f"Execution Cost: {cost_add}")
print(f"Result: {result_add.as_int()}")
Errors
Common errors & fixes
TypeError: 'int' object is not callable
Attempting to pass a native Python integer directly as a program argument to `run_program` or an `SExp` method.
fixConvert the integer to an `SExp` object first. For example, `args = assemble('(5)')` or `args = SExp.to(5)`. NameError: name 'assemble' is not defined
The `assemble` function for compiling Chialisp code is part of the `clvm_tools` package and needs to be explicitly imported.
fixAdd the import: `from clvm_tools.binutils import assemble`.
clvm.clvm_tools.binutils.assemble.AssembleError: bad expression
The Chialisp code provided to `assemble` contains syntax errors, such as unbalanced parentheses, invalid atoms, or incorrect operator usage.
fixCarefully review the Chialisp string for syntactical correctness. Chialisp follows s-expression rules, requiring balanced parentheses and valid atom definitions.
ModuleNotFoundError: No module named 'clvm_tools'
The `clvm_tools` package, which provides essential utilities like `assemble` and `disassemble`, is a separate dependency and has not been installed.
fixInstall `clvm_tools` via pip: `pip install clvm_tools`.
Upgrade
Version history
0.9.15latest on PyPI · released Sep 17, 2025
Audit
Dependencies
clvm_rsrequiredRust-accelerated CLVM runtime for performance.
clvm_toolsrequiredProvides Chialisp assembly/disassembly utilities (e.g., 'assemble'). Essential for working with human-readable Chialisp.
bls-signaturesrequiredRequired for BLS signature operations within CLVM programs.
chia_rsrequiredRust bindings for various Chia primitives.