'the correct way to use nornir plugins

I am a beginner with nornir, I am trying to run nornir plugins but I am having these errors:

Traceback (most recent call last):
  File "nornirpy/start.py", line 2, in <module>
    from nornir.plugins.tasks.commands import commands
ModuleNotFoundError: No module named 'nornir.plugins.tasks.commands'

My start.py file is very basic:

from nornir import InitNornir
from nornir.plugins.tasks.commands import commands
from nornir.core.inventory import Host
from path.to import InventoryPlugin
import json

nr = InitNornir("nornirpy/config.yml")

print(json.dumps(Host.schema(), indent=4))

What is the issue? I am using poetry to organize my project, is there a step I forgot? its not clear to me how can I use plugins in my application.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source