top of page
  • Rosablanche

How to install Python for Tableau: step-by-step guide

Updated: Mar 8, 2021

It's possible to create calculations based on python scripts with Tableau, but there's many steps involved. Here's a how-to guide.

Regarding Python, different visualisation tools use it for different purposes. For instance, PowerBI allows you to create new charts types with Python, but you can't use it in calculated key figures.

With Tableau, the important thing to note is that Python will return the result of a calculation but can't be used to create a new chart type.

 

First you need to install Python on your machine from the python website.


You also need to install popular libraries for charts such as matplotlib and seaborn.

You also need to install the Tableau package TabPy.

In order to do so, use the pip tool (it's normally packaged with python).


Open the Windows command prompt (cmd) and type commands such as:

pip install matplotlib
pip install seaborn
pip install tabpy

Start the service in the Windows command prompt (cmd) with the command below. You might get a warning from your firewall asking you to authorise this program.


tabpy

Open Tableau Desktop and enable the service with the Help menu / Settings and Performance / Manage Analytics Extension Connection.


Enter Server = localhost; Port = 9004. Click "OK".

I've got version 2020.4 and I didn't get a confirmation message but still it worked.



You can now use Python with Tableau !


Next step is to implement some Python code.


Implementation is done within a calculated field. You can enter scripts there that do just about anything. Like any other calculated field, you can leverage parameters for instance.


Resources:




17 views0 comments

Recent Posts

See All

Web data import to Tableau

So I needed to reuse data from a table in a web page to support a visualisation in Tableau and I thought surely there's a way of achieving already available in standard. Well, no... The web data conne

How I aced the Tableau certification

From zero to hero in less than a month, my journey to the Tableau Desktop Specialist certification. Tableau is a very popular visualisation tool and high in demand on the job market so I figured it wo

DSC02405-Edit.jpg

Rosablanche

A BLOG ABOUT ANALYTICS & DATA
bottom of page