Reputation: 75
I want to put rest api output to a file with python script.
test1.py - python script
import urllib.request
abc = urllib.request.urlopen('http://xxxxxxx')
print(abc.read())
Python code is fine.
but An error occurs in nifi.
ImportError: No module named request in at line number 1
what should i do?
What's the problem? Is it a Jython problem? How can I solve this?
please help me thank you.
Upvotes: 0
Views: 2089
Reputation: 13541
That is Jython and you cannot use the external packages of the python in general. I'd recommend you to use the ExecuteStreamCommand
with the options,
Command Arguments /path/to/test1.py
Command Path /path/to/python
where the python should be installed separately in the NI-FI server.
Upvotes: 1