Install & Compatibility
Where this runs
tested against v3.5.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.910 runs
installs and imports cleanly · install 0.0s · import 0.190s · 19.2MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 2.2s · import 0.174s · 20MB
21MB installed
● package 21MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
InitNornir
✓ from nornir import InitNornir
✗ from nornir.core import InitNornir
InitNornir is in the top-level nornir package since v3.0.
NRF
✓ from nornir.plugins.functions import NRF
Filter
✓ from nornir.core.filter import F
✗ from nornir import Filter
The F class is used for filtering hosts.
Basic example: initialize Nornir with an inline dict inventory, run a simple task, and print the result.
from nornir import InitNornir
from nornir.core.task import Task, Result
# Create a simple inventory definition inline
nr = InitNornir(
inventory={
"plugin": "DictInventory",
"options": {
"hosts": {
"router1": {
"hostname": "192.0.2.1",
"username": "admin",
"password": "password"
}
}
}
}
)
# Define a task
def hello_task(task: Task) -> Result:
return Result(host=task.host, result=f"Hello from {task.host.name}")
# Run the task
results = nr.run(task=hello_task)
print(results['router1'][0].result)
# Close connections if any
nr.close_connections()
nornir --version
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'nornir'
Nornir is not installed.
fixRun `pip install nornir`
nornir.core.exceptions.NornirUnsupportedConfigSchema: Unsupported config schema
The configuration dictionary passed to InitNornir does not match the expected schema (e.g., using a plugin not recognized).
fixEnsure you are using the correct plugin names and options as per Nornir 3 documentation. For DictInventory, use `inventory={'plugin': 'DictInventory', 'options': {...}}` AttributeError: 'str' object has no attribute 'name'
In Nornir 3, task function should accept a `Task` object, not a hostname string. The first argument is the task instance, and the host is accessed via `task.host`.
fixDefine your task function like: `def my_task(task: Task) -> Result: host = task.host`
AttributeError: 'Nornir' object has no attribute 'run'
Using Nornir 2.x style `nr.run()`. In Nornir 3, the method is `nr.run()` but the task function signature changed. If you see this error, you might be using an old version or mixing APIs.
fixEnsure you are using Nornir 3.x and that your task function is defined correctly (accepts a single `task` argument).
Upgrade
Version history
3.5.0latest on PyPI · released Jan 8, 2025
Audit
Dependencies
nornir-utilsoptionalProvides common tasks like netmiko_send_command, napalm_get, etc.