Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

The highly anticipated Alteryx Community tradition is back! We hope you'll join us!

Learn More

Run Command Tool - Code 2 Error


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.  






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.



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.