Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
ALTER.NEXT:

Join us on Dec 2 for a half-day virtual analytics + data science event!
US & CA customers only

SAVE YOUR SPOT
It's the most wonderful time of the year - Santalytics 2020 is here! This year, Santa's workshop needs the help of the Alteryx Community to help get back on track, so head over to the Group Hub for all the info to get started!
SOLVED

Run Command Tool - Code 2 Error

Highlighted
5 - Atom

Hi All,

 

I have been running into issues every time that I try and execute a python script using the Alteryx run command tool.  Screenshot of the error below.  I did read through some of the other posts on run command errors but couldnt seem to rectify the error.  Appreciate it if you could look into this.  

 

Also - I have tested the script and am able to run it successfully via the Windows CMD tool.  

 

Rgds,

Ishan

code2error.PNG 

Highlighted
Alteryx
Alteryx

Hi @Ishan

 

An error code of 2 is usually (not always) file not found.

 

This to me would suggest that your python script isn't correctly picking up the file. Are you using a relative path in your script? As it may be that when you run it from the cmd line you are in a different location and that is why it works.

 

Could you switch your script to either use a full path, or what might be better still to accept an argument with the path and pass that through from Alteryx.

 

Highlighted
5 - Atom

Thanks Joe,

 

When I input the full file path - it works but now returns a code 1 error which seems to me that it is not liking something that is in the script.  Seems a bit odd that it works fine when I run the script in the Python shell or via the cmd tool it works fine - but returns a code 1 error. 

 

I have also tried replacing my script with a simple one line Print('Hello World') which runs without any issues.  Are there any known issues with running longer scripts via the run command tool in Alteryx?  I call on packages such as pulp, numpy and e.t.c in the script.   

Highlighted
5 - Atom

I know this thread is from 2 years ago but did you ever find the solution? I'm have a similar issue currently.

Highlighted
Alteryx
Alteryx

Hi @elerman 

 

It's like that the paths you are using are relative paths and when you run it in Alteryx the relativity changes thus them not being found.

 

If you use absolute paths this should help with that.

 

If that's not it could you share the issue you are actually having along with the error please?

Labels