This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
Welcome to the Jupyter Flow Basics guide! If you're well versed on Jupyter and python virtual environments, you may consider the Jupyter Flow Help docs instead, which cuts straight to the chase. Or you may want to skip to section V in this guide! Visit Introducing the Jupyter Flow tool for an introduction to the tool and it's capabilities.
Here you will learn how to install Python, manage virtual environments, create and integrate Jupyter notebooks into Alteryx workflows, export and share those workflows, and run them on Server. Sections I through IV are intended for users who have no experience with python, virtual environments, Jupyter, or creating Jupyter notebooks.
Before starting this guide, make sure you have Alteryx Designer version 2020.4 or later, and have installed Jupyter Flow onto your system.
Note: the following guide uses Windows command line arguments. These arguments will be different depending on the operating system you’re using.
You can skip this step if you already have python 3.8.5 installed, or you already have a preferred method to create python installs. Simply note that this tool has only been tested with Python 3.8.5 environments.
Download the correct Python installer for your system
Follow the instructions to install Python 3.8.5
Open a new command prompt and type “python” and press “Enter”. If you get a python interpreter like this, you can skip steps 4 through 6:
Find out where python was installed
If installed as a user, you may find it at "C:\Users\your_username\AppData\Local\Programs\Python\Python38\"
Add this path to your user PATH environment variable
If you would prefer not to add this to your PATH, simply use the full path to python for the rest of this guide.
Everywhere in this guide you see the following code, replace python with your version of the full path to your installed python version (ex: "C:\Users\your_username\AppData\Local\Programs\Python\Python38\python.exe"):
python <<some_commands>>
You can skip this section if you already know how to create a virtual environment and add packages to it using pip.
mkdir my_envs
cd my_envs
python -m venv first_environment
dir
first_environment\Scripts\pip.exe install pandas
Note: If you would like to pass data to/from Alteryx workflows and your notebook, you will need to use pandas at this time. Notebooks can run without Pandas, but the only way to pass data in/out of a notebook currently is via pandas.
You can skip this step if you already know how to use Jupyter. Simply note two things: DLL kernel errors may be fixable by installing pywin32==300 in the environment you use to run Jupyter, and you should install jupyter_client 6.1.12 if installing jupyter in your environment.
first_environment\Scripts\pip.exe install jupyter jupyter_client==6.1.12
first_environment\Scripts\pip.exe install pywin32==300
first_environment\Scripts\jupyter.exe notebook
You can skip this step if you already know how to create and run Jupyter notebooks.
import pandas as pd
data = pd.DataFrame({"text": ["Jupyter", "by", "itself"], "number": [1,2,3]})
data
!dir
Summary: After specifying a notebook and site-packages, the tool will build an environment for the notebook to run in, and then run the notebook. The environment only builds the first time a new set of packages are specified, but can take some time. If the packages or versions thereof change, the environment will build again.
Summary: Adding #ayx_input=<<name of alteryx input connection>> above a variable assignment will replace that variable with a dataframe representation of the data flowing through the input connection specified. Adding #ayx_output=<<output anchor number>> above a variable or a variable assignment will output the variable (assuming it's a pandas dataframe) to the specified output anchor in the workflow.
#ayx_output
data
Summary: Using Alteryx Designer's built-in export workflow feature will export all of the assets required for another user (or a Server) to run a workflow containing this tool. The environment packages will be exported inside the .yxzp file.
Banner image by Beate Bachman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.