Install & Compatibility
Where this runs
tested against v0.2.6 · 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.792s · 59.2MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 5.9s · import 0.764s · 62MB
60MB installed
● package 60MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
TraceFrame
✓ from evm_trace import TraceFrame
CallTreeNode
✓ from evm_trace import CallTreeNode
✗ from evm_trace.call_trace import CallTreeNode
The correct import is from the top-level package.
Parses a raw EVM trace frame into a structured object. Replace raw_frame with actual trace data from an RPC provider.
from evm_trace import TraceFrame
# Example: process a raw trace dict
raw_frame = {
'pc': 0,
'op': 96,
'gas': 100000,
'gas_cost': 3,
'depth': 0,
'stack': [],
'memory': [],
'storage': {}
}
tf = TraceFrame.parse_obj(raw_frame)
print(tf.op) # 96 (PUSH1)
Errors
Common errors & fixes
ImportError: cannot import name 'CallTreeNode' from 'evm_trace.call_trace'
The CallTreeNode class is re-exported from the top-level package, not from the submodule.
fixUse: from evm_trace import CallTreeNode
ModuleNotFoundError: No module named 'msgspec'
evm-trace version 0.2.4 removed msgspec from dependencies, but it's required for some optional functionality.
fixInstall msgspec separately: pip install msgspec, or upgrade evm-trace to >=0.2.5.
TypeError: Object of type 'TraceFrame' is not JSON serializable
Custom objects need serialization utilities.
fixUse .dict() or .json() methods from Pydantic base model.
Upgrade
Version history
0.2.6latest on PyPI · released May 22, 2025
Audit
Dependencies
pydanticrequiredUsed for data models since v0.2.5.
eth-utilsrequiredCore Ethereum utility functions.
eth-hashrequiredKeccak256 hashing support.