Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

Alteryx Designer Desktop Discussions

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

How I can execute my python script from our local machine into alteryx?

AKPWZ
8 - Asteroid

Hi, I just want to know how we can execute a python script in alteryx? 
My python script is in my local machine as you can see in the attached screenshot. The script which I want to execute/run is "front-app-download.py".

Can anyone please guide me how to do this. Thanks 

4 REPLIES 4
Emil_Kos
17 - Castor
17 - Castor

Hi @AKPWZ,


I was learning python in the past but I never had a chance to use python in Alteryx myself. If my answer will be incorrect don't blame me 😛


I found this post I am assuming it should work for you:

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Run-a-python-script-in-Alteryx/m-p/109...

echuong1
Alteryx Alumni (Retired)

The Python tool is another option, if you want to have the script run as part of your workflow and use the resulting data. See here for the Tool Mastery:

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Tool-Mastery-Python/ta-p/197860 

 

You can also import your existing script by going to Alteryx > Menu > Import Script.

AKPWZ
8 - Asteroid

Thank you for your response. I tried to import my python script into the python tool as you mentioned but I'm getting this error - attached the screenshot.

How can I solve this error and can run my script to see the output.

Basically my script is using some API to fetch some data as per the requirement. Thank you

pedrodrfaria
13 - Pulsar

Hi @AKPWZ 

 

Can you show us the error in the python tool? It would show up like normally under the container/block with the python code. This way we can have a better understanding.

 

Some considerations without knowing the error:

 

Make sure to import all the necessary packages and libraries for Alteryx/Python.

If you are trying to pull a data input as a variable, Alteryx lists above the correct way to pull it as a variable.

To write a variable as the output to come out in one of the anchors, you need to convert it to a pandas dataframe, so make sure to call it as well.

 

Let me know the error and we can pinpoint what is not properly configurated.

Labels