Run Command Tool - Code 2 Error
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
Solved! Go to Solution.
- Labels:
- Python
- Run Command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I know this thread is from 2 years ago but did you ever find the solution? I'm have a similar issue currently.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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?
