python-3.x - 没有名为“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'
谁能帮我解决这个问题?
解决方案
在nornir
模块文档中查看没有print_result
功能,但它存在于nornir_utils
模块中。
里面的插件nornir
有四个,看这里
您可以将模块nornir_utils
安装为.pip install nornir_utils
nornir
pip install nornir
要做的正确导入是from nornir_utils.plugins.functions import print_result
.
确保使用正确的 pip 来安装软件包,有时我安装在错误的环境中并安装了多个 python。
推荐阅读
- paypal - PayPal webhook 自定义标头
- php - PHP PDO 一旦分配给变量就会挂起
- ios - 无法在flutter ios应用程序的谷歌登录中显示“选择帐户”表单
- reactjs - 如何使用“normalizr”规范化这个简单的 API 响应?
- c - C中的POSIX信号量但仍然有竞争条件?
- python - 如何在熊猫数据框中查找重复项并打印它们
- npm - 如何使用 npm 监视文件夹中文件的更改?
- python - 如果我想给我的进程池更多的工作,我可以在 Pool.close() 之前调用 Pool.join() 吗?
- html - 如何在 h1 标题左侧对齐我的徽标?
- swift - 非活动导航按钮