Created 10-04-2018 07:40 PM
Hi
I am trying to execute python script using executestreamcommand processor . it was giving error "No Such file or Directory " even file is available in respective directory
my Flow => Generate file processr --> Execute stream command processor
I was two methods for passing arguments to Execute stream command processor for
Method 1:
${arg1},${argg} are passed by generate file processor
commandarguments :/home/suresh/Desktop/wquest1.py ${arg1};${arg2}
command path : python3.6
Method 2:
commandarguments : wquest1.py ${arg1};${arg2}
command path : python3.6
Working directory : /home/suresh/Desktop/
Please help me on this issue . Thanks for your time and consideration
Created 10-05-2018 04:06 AM
For "command path" you probably want something like: "/usr/bin/python3.6" or "/usr/bin/python3"
You can find the exact path to Python by issuing "which python3" from a shell. It may vary between distributions.
When you execute a script through NiFi it doesn't have the environment variables set like a regular user with shell access might. One of these very important environment variables is PATH, which includes the location of /bin and /usr/bin , so when you type "python" at a shell, it knows where to look for whatever "python" is if it's not found in the current directory.
Created 10-05-2018 04:06 AM
For "command path" you probably want something like: "/usr/bin/python3.6" or "/usr/bin/python3"
You can find the exact path to Python by issuing "which python3" from a shell. It may vary between distributions.
When you execute a script through NiFi it doesn't have the environment variables set like a regular user with shell access might. One of these very important environment variables is PATH, which includes the location of /bin and /usr/bin , so when you type "python" at a shell, it knows where to look for whatever "python" is if it's not found in the current directory.
Created 10-05-2018 07:48 PM
Thanks for your Answer