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.
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.