Install & Compatibility
Where this runs
tested against v9.2.213 · 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.920 runs
build_error
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 2.8s · import 0.530s · 28MB
27MB installed
● package 27MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
pyvex
✓ import pyvex
✗ import pyvex
import archinfo
IRSBCaller
✓ from pyvex import IRSBCaller
✗ pyvex.lift
IRExpr
✓ from pyvex import IRExpr
This quickstart demonstrates how to lift a small block of AMD64 NOP instructions into PyVEX's IRSB (Intermediate Representation Super-Block). It then pretty-prints the entire IRSB, iterates through its statements, and shows how to access the default exit (jump target) expression and kind. This requires `archinfo` to be installed.
import pyvex
import archinfo
# Binary code: 5 NOPs (0x90) for AMD64
binary_code = b"\x90\x90\x90\x90\x90"
# Base address for the code
base_address = 0x400400
# Architecture definition
architecture = archinfo.ArchAMD64()
# Lift the binary code into a VEX Intermediate Representation Super-Block (IRSB)
irsb = pyvex.lift(binary_code, base_address, architecture)
print("--- Lifted IRSB ---")
irsb.pp() # Pretty-print the IRSB
print("\n--- IRSB Statements ---")
for stmt in irsb.statements:
stmt.pp()
print("\n--- Next IR Expression (Jump Target) ---")
irsb.next.pp()
print(f"Jump Kind: {irsb.jumpkind}")
Debug
Known issues
breakingMajor version bumps (e.g., from 8.x to 9.x) in pyvex, especially as part of the broader angr project, can introduce API changes and require specific dependency versions. This can necessitate updating related libraries like `archinfo` and `angr` in tandem to maintain compatibility.fixConsult the `angr` and `pyvex` release notes for detailed migration guides. Ensure all `angr` ecosystem libraries are updated to compatible versions.
affects: <9.0.0
gotchaWhen lifting certain instruction types (e.g., MIPS branches or jumps) with `max_inst=1` (limiting to one instruction), PyVEX might return an empty IRSB because these instructions often require 'delay slots' to be processed together. This can lead to a `SimIRSBError` if an empty block is passed to downstream analysis.fixAvoid `max_inst=1` for architectures with delay slots or complex instruction semantics. Allow PyVEX to lift more bytes/instructions or handle `SimIRSBError` gracefully by checking if the IRSB is empty (`len(irsb.statements) == 0`).
affects: All versions
gotchaPyVEX provides a *syntactic* representation of a basic block. This means it describes the operations and control flow but does not inherently provide semantic context like the actual data written by a store instruction or the live values of registers at a given point without further analysis.fixFor deeper semantic analysis (e.g., dataflow, symbolic execution), integrate PyVEX with higher-level binary analysis frameworks like `angr` which build this context upon the VEX IR.
affects: All versions
gotchaWindows installations might encounter C compiler errors, often related to missing include files (e.g., 'stdarg.h') during the build process of the underlying libVEX C component, even with Visual Studio installed.fixEnsure that the necessary C/C++ build tools for Visual Studio are fully installed, including desktop development with C++ workloads. Sometimes, manually launching the appropriate 'x64 Native Tools Command Prompt for VS' and running `pip install pyvex` from there can resolve environment path issues.
affects: All versions on Windows
Upgrade
Version history
9.2.221latest on PyPI · released Jun 3, 2026
Audit
Dependencies
pythonrequiredRequired Python version.
bitstringrequiredRuntime dependency for bit manipulation.
cffirequiredUsed for Python Foreign Function Interface to interact with libVEX (C library).
archinforequiredProvides architecture definitions necessary for lifting binary code into VEX IR. While not a hard PyPI dependency, it is practically required for most usage.