Install & Compatibility
Where this runs
tested against v0.6.2 · 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.000s · 17.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.014s · 25MB
19MB installed
● package 19MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Builder
✓ from pyqir import Builder
BasicBlock
✓ from pyqir import BasicBlock
Context
✓ from pyqir import Context
Module
✓ from pyqir import Module
Qubit
✓ from pyqir import Qubit
__version__
✓ from pyqir import __version__
✗ import pyqir; pyqir.__version__
Also valid, but direct import is clearer.
evaluate
✓ from pyqir.evaluator import evaluate
✗ from pyqir import evaluate
evaluate is a submodule.
SimpleEvaluator
✓ from pyqir.evaluator import SimpleEvaluator
✗ from pyqir import SimpleEvaluator
SimpleEvaluator is in evaluator submodule.
__qir__
✓ from pyqir import __qir__
Provides access to QIR constants.
Create a simple QIR module with a Hadamard and measurement, then evaluate it.
from pyqir import Builder, BasicBlock, Context, Module, Qubit
from pyqir.evaluator import evaluate
context = Context()
module = Module(context)
builder = Builder(context)
entry = BasicBlock(context, "entry", module)
builder.insert_at_end(entry)
qubit = builder.add_qubit()
builder.h(qubit)
builder.mz(qubit)
result = evaluate(module, {})
print(result)
Errors
Common errors & fixes
AttributeError: module 'pyqir' has no attribute 'evaluate'
Trying to import evaluate directly from pyqir instead of pyqir.evaluator.
fixReplace 'from pyqir import evaluate' with 'from pyqir.evaluator import evaluate'
ImportError: cannot import name 'SimpleEvaluator' from 'pyqir'
SimpleEvaluator is in a submodule, not directly in pyqir.
fixReplace 'from pyqir import SimpleEvaluator' with 'from pyqir.evaluator import SimpleEvaluator'
RuntimeError: Unable to find a prebuilt wheel for pyqir on this platform
No prebuilt wheel for your platform (e.g., ARM Linux, Python 3.8).
fixUpgrade to Python >=3.9 or build from source using maturin.
AttributeError: 'NoneType' object has no attribute 'context'
Builder or BasicBlock was used before being properly initialized.
fixEnsure you create a Context first and pass it to all objects.
Upgrade
Version history
0.12.5latest on PyPI · released May 12, 2026
Audit
Dependencies
No dependency data recorded yet.