首页 > 解决方案 > 没有名为“nornir_utils”的模块

问题描述

我正在尝试与 nornir 合作,但我明白了

当我尝试这个时:

from nornir.plugins.functions.text import print_result

我明白了:

ModuleNotFoundError: No module named 'nornir.plugins.functions.text'

我也试过这个:

from nornir_utils.plugins.functions import print_result

问题仍然存在:

ModuleNotFoundError: No module named 'nornir.plugins.functions.text'

谁能帮我解决这个问题?

标签: python-3.xnetmiko

解决方案


nornir模块文档中查看没有print_result功能,但它存在于nornir_utils模块中。

里面的插件nornir有四个,看这里

您可以将模块nornir_utils安装为.pip install nornir_utilsnornirpip install nornir

要做的正确导入是from nornir_utils.plugins.functions import print_result.

确保使用正确的 pip 来安装软件包,有时我安装在错误的环境中并安装了多个 python。


推荐阅读