Install & Compatibility
Where this runs
tested against v0.7.1 · 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 4.4s · import 0.370s · 138MB
133MB installed
● package 133MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Model
✓ from dwave.optimization import Model
✗ from dwave_optimization import Model
Package uses dot notation, not underscore.
DWaveSampler
✓ from dwave.system import DWaveSampler
✗ from dwave.optimization.samplers import DWaveSampler
Sampler is in dwave-system, not in dwave-optimization.
Symbol
✓ from dwave.optimization import Symbol
Basic nonlinear model creation and sampling via D-Wave hybrid solver.
from dwave.optimization import Model
import os
# Create a model with a symbol
model = Model()
x = model.integer(0, 10, num=3)
model.minimize(sum(x))
# Submit to a solver (requires Leap API token)
token = os.environ.get('DWAVE_API_TOKEN', '')
if token:
from dwave.system import DWaveSampler
sampler = DWaveSampler(token=token)
sampleset = sampler.sample(model)
print(sampleset.first)
else:
print('DWAVE_API_TOKEN not set; install dwave-neal for local sampling from dimod')
Errors
Common errors & fixes
ImportError: No module named 'dwave_optimization'
Incorrect import path; package uses dot notation.
fixUse 'from dwave.optimization import Model' (dot, not underscore).
ModuleNotFoundError: No module named 'dwave.system'
Sampler is in dwave-system, which is not installed by default.
fixInstall the missing package: pip install dwave-system
AttributeError: 'Model' object has no attribute 'sample'
The Model class does not have a sample method; use a sampler from dwave.system.
fixUse DWaveSampler from dwave.system to sample the model.
Upgrade
Version history
0.7.1latest on PyPI · released Jun 5, 2026
Audit
Dependencies
dwave-systemoptionalRequired for access to D-Wave solvers via DWaveSampler
dimodrequiredCore shared library for binary quadratic models
numpyrequiredNumerical arrays for model data