Install & Compatibility
Where this runs
tested against v0.8.19 · 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 5.3s · import 0.870s · 149MB
153MB installed
● package 153MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
dwave_networkx
✓ import dwave_networkx as dnx
✗ import dwave_networkx.dwave_networkx as dnx
dwave_networkx is a top-level package, not a submodule of itself.
chimera_graph
✓ from dwave_networkx import chimera_graph
Correct import for Chimera graph generator.
draw_chimera
✓ from dwave_networkx import draw_chimera
✗ import dwave_networkx.draw.draw_chimera
Drawing functions are exposed at the top level.
Basic usage: create a D-Wave graph and solve a problem using dwave-networkx algorithms.
import networkx as nx
import dwave_networkx as dnx
import dimod
# Create a Chimera graph (hardware graph)
G = dnx.chimera_graph(1, 1, 4)
print(f"Nodes: {len(G.nodes)}, Edges: {len(G.edges)}")
# Example: maximum independent set (QUBO formulation)
from dimod import ExactSolver
# Solve maximum independent set on a small graph
H = nx.path_graph(3)
qubo, offset = dnx.algorithms.independent_set.maximum_independent_set_qubo(H)
sampler = ExactSolver()
sampleset = sampler.sample_qubo(qubo)
solution = dnx.algorithms.independent_set.maximum_independent_set(H, sampler)
print(f"Maximum independent set: {solution}")
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'dwave_networkx'
Package not installed or installed in wrong environment.
fixRun 'pip install dwave-networkx' in the correct Python environment.
ImportError: cannot import name 'chimera_graph'
Using incorrect import path (e.g., from dwave_networkx.generators import chimera_graph instead of from dwave_networkx import chimera_graph).
fixUse 'from dwave_networkx import chimera_graph'.
AttributeError: module 'dwave_networkx' has no attribute 'draw_chimera'
Matplotlib is not installed, or using an old version of dwave-networkx before drawing functions were added.
fixInstall Matplotlib: 'pip install matplotlib'. If that doesn't work, update dwave-networkx to >=0.8.10.
ValueError: The graph is not bipartite?
Using a graph not compatible with the expected topology (e.g., trying to embed a non-bipartite graph into a Chimera structure).
fixEnsure the input graph matches the topology requirements. Check the documentation for the specific algorithm.
Upgrade
Version history
0.8.19latest on PyPI · released Jun 16, 2026
Audit
Dependencies
networkxrequiredCore dependency: extends NetworkX with D-Wave specific graph topologies and algorithms.
dimodrequiredRequired for QUBO formulations and converting to binary quadratic models used by D-Wave systems.