Install & Compatibility
Where this runs
tested against v3.3.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 2.9s · import 0.060s · 49MB
131MB installed
● package 131MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
pypcode
✓ import pypcode
✗ from pypcode import *
Wildcard imports are discouraged and may pollute the namespace.
pypcode.Arch
✓ from pypcode import Arch
Direct import of Arch class as used in quickstart.
pypcode.Context
✓ from pypcode import Context
Context is the core disassembly object.
Initialize a disassembly context for x86-64, disassemble a few bytes, and print the disassembly.
import pypcode
# List supported architectures
print(pypcode.Arch.list())
# Create a context for x86-64 (default little endian)
ctx = pypcode.Context.by_name("x86:LE:64:default")
# Set the spec (architecture specification)
ctx.set_spec("x86:LE:64:default")
# Disassemble some bytes
code = bytes([0x48, 0x89, 0xe5, 0x48, 0x83, 0xec, 0x10])
ctx.disassemble(code, base=0x4000)
# Get disassembly lines
for line in ctx.disassembly_lines():
print(line)
Errors
Common errors & fixes
ImportError: cannot import name 'open' from 'pypcode'
pypcode 3.x removed the 'open' function.
fixUse 'pypcode.Context.by_name()' and 'ctx.set_spec()' instead.
AttributeError: module 'pypcode' has no attribute 'Arch'
The 'Arch' module may not be imported implicitly; also possible version mismatch.
fixEnsure you have installed pypcode >=3.0.0 and use 'import pypcode; pypcode.Arch.list()'.
RuntimeError: Failed to load spec for x86:LE:64:default
The spec name is incorrect or the required SLEIGH files are missing (especially when using custom specs).
fixUse correct spec name from 'pypcode.Arch.list()' or install Ghidra processor specs if using custom ones.
Upgrade
Version history
4.0.0latest on PyPI · released May 16, 2026
Audit
Dependencies
pycparserrequiredRequired for parsing SLEIGH specs during build