Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Run Command Tool - Code 2 Error

Ishan
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 

4 REPLIES 4
JoeS
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.

 

Ishan
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.   

elerman
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.

JoeS
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