Install & Compatibility
Where this runs
tested against v2.6.0 · 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.036s · 18MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.036s · 18MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Graph
✓ from dijkstar import Graph
Correct import for the Graph class.
find_path
✓ from dijkstar import find_path
Correct import for the pathfinding function.
Create a weighted graph and find the shortest path between two nodes.
from dijkstar import Graph, find_path
graph = Graph()
graph.add_edge(1, 2, 100)
graph.add_edge(2, 3, 200)
path_info = find_path(graph, 1, 3)
print('Shortest path:', path_info.nodes)
print('Total cost:', path_info.total_cost)
Errors
Common errors & fixes
AttributeError: module 'dijkstar' has no attribute 'Graph'
Importing incorrectly (e.g., import dijkstar then dijkstar.Graph) or having a different version where Graph is not top-level.
fixUse: from dijkstar import Graph
KeyError: node not in graph
Attempting to find a path from or to a node that has not been added to the graph.
fixEnsure all nodes in the path query are present in the graph.
Upgrade
Version history
2.6.0latest on PyPI · released Mar 30, 2021
Audit
Dependencies
No dependency data recorded yet.