Jerry Hong

Logo

View the Project on GitHub jerry-hong7/my-portfolio

Back to Home

A Guide to Install Python, TabPy, and Visual Studio Code to Elevate your Data Science Workflow

Jerry Hong

Python. TabPy. VSCode.

Table of Contents

  1. Overview
  2. Pre-requisites
  3. Installing Python
  4. Installing TabPy
  5. Installing Visual Studio Code

Overview

This guide will show you how to install three useful pieces of software. According to the Institute of Electrical and Electronics Engineers (IEEE), Python remains among the top of the most popular programming languages. TabPy is a great tool for Tableau Prep Builder where it can allow users to execute Python scripts to run various scripts and functions into Tableau. To learn more, refer to the documentation. Finally, a popular integrated development environment, or IDE, is Visual Studio Code, commonly referred to as VS Code. This IDE is popular among users for its UI customization and seamless integration with many commonly used programming languages. The goal of this guide is to seamlessly install these important tools to optimize our workflow and important needs.

Pre-requisites

To begin installation, the following pre-requisites are needed:

Installing Python

After you meet the pre-requisites, let’s get started by installing Python! To start, go to the official Python download page. Please make sure you are downloading the right installer for your Operating System (OS). For my demonstration, I will be using Windows 11.

  1. Go to the Python download page listed above
  2. Run the installer (Agree to any terms and conditions as the installer is running)
    • NOTE: Make sure you check Add python.exe to PATH as it will allow you to run Python scripts and install packages from the command prompt.

Congratulations! Now Python is installed on your computer! Now let’s install TabPy through the command line.

Installing TabPy

Now that you have Python installed, let’s integrate it with Tableau Prep Builder! Please make sure you have the software available on your personal computer.

  1. Open the command prompt (ensure that you run as administrator)

  1. Run the following command: python -m pip install upgrade pip

    (This will check if you have the latest Python package installer)

    • If there is a new version of pip, run the following command: python.exe -m pip install --upgrade pip
    • To check your current version of pip, run pip -V
      • The latest version of pip is 23.2.1

  1. If you have any packages needed to install, use the pip install command. For this demo, we will install tabpy and the gender-guesser package (I already have these packages installed, but make sure it runs before you make the next command)

  1. Enter tabpy and select y/N if you want to proceed with or without authentication

    • For this demo, we will proceed without authentication, but for security purposes, it is best to include credentials prior to synchronization.

  1. Go to a web browser and type: http://localhost:9004

  1. Head to Tableau Prep Builder and navigate to Manage Analytics Connection

  2. Select the Tableau Python (TabPy) Server and enter the information as follows and sign in:

    • Server: localhost
    • Port: 9004

Congratulations! Now Python is integrated with Tableau Prep Builder!

TabPy in Action

Now that you have integrated Python into Tableau Prep Builder, let’s see this in action! As described, this can allow users to run Python scripts to further manipulate and clean their data set.

  1. Open Tableau Prep Builder

  2. Open a flow (this is the main project file in Prep Builder stored as a .tfl file)

  3. Add a step to the flow and select Add script (We will be using the gender_guesser script as a demo)

    (NOTE: Make sure the connection is on TabPy and not Rserve)

  1. Add your Python script. In this demo, this is the gender_guesser.py script.

  1. Add a function from the script for which to run on your Tableau flow.

Once the script runs, you will see that there is an added column called ‘Gender’ to our data set. This will add additional information about the clients and form new insights as we work through the data set. That is a short demo of TabPy!

Installing Visual Studio Code

Let’s get started installing Visual Studio Code! To start, go to the official VS Code download page. Again, make note you are downloading for the right OS.

  1. Go to the VS Code download page listed above
  2. Run the installer (Make sure to agree any terms and conditions as the installer is running)

Congratulations! Now Visual Studio Code is installed on your computer! Happy coding!

Disclaimer: If you encounter any issues, please ensure your operating system is updated and the software installer is the latest version. Please make note of any steps listed as you install any of the above tools. Also, the Internet is a great resource for troubleshooting!