如何在nifi

时间:2019-11-28 02:34:37

标签: python apache-nifi

我想用python脚本将其余的api输出放到文件中。

enter image description here enter image description here

  

test1.py-python脚本

     

导入urllib.request

     

abc = urllib.request.urlopen('http://xxxxxxx')

     

print(abc.read())

Python代码很好。

enter image description here

但是nifi发生错误。

  

ImportError:第1行没有模块命名为请求

enter image description here

我该怎么办?

出什么问题了?是Jython问题吗?我该怎么解决?

请帮助我,谢谢。

1 个答案:

答案 0 :(得分:1)

那是Jython,您通常不能使用python的外部软件包。我建议您将ExecuteStreamCommand与选项一起使用

Command Arguments      /path/to/test1.py
Command Path           /path/to/python

应该在NI-FI服务器中单独安装python的地方。