How to install DBT on a Windows system

How to install DBT on a Windows system

When it comes to installing (some) software on you windows laptop it might not end up well for you. It is the same with DBT. And I have spend many hours trying to get it done. But I am going to give you the solution that worked for me. Let's jump in...

The first thing you need to do is to add the path to the python into environmental variables. In my case I have installed python through Anaconda (but its enough to find the path to the "python.exe" in any other case). So I had following three paths to include. Remember not to end these lines with a "/". Add these to the existing "PATH" variable.

C:\ProgramData\Anaconda
C:\ProgramData\Anaconda3\Scripts
C:\ProgramData\Anaconda3\Library\bin3        

Next I recommend using "Visual Studio Code (VSCode)" or similar to work with DBT. Installing such software is straightforward. Assuming you have install it, lets fire it up. Then go to the code editor (Cntl + `). Your default code editor in windows will open inside VSCode. Now you can verify if the first step is successful by running the following command. This should display your current python version (ex" Python 3.9.0).


python -V        

After that choose a master location so that you can install all the DBT stuff once and for all. TIP: Use shorter name for this location (I will explain why later). I used "dbt-env". Navigate to that folder inside VSCode from the code editor. And create a python virtual environment there by executing following command.


mkdir dbt-env

cd dbt-env

python -m venv dbt-env        

Next is the important step, activating it on the windows system using windows default code editor like "cmd" or "powershell". The following is the way to do this, and the syntax is a bit different from "linux" or "mac" system.


cd dbt-env

.\Script\activate        

Your code editor will show that you are now inside the virtual environment created.

Then is the time to actually install DBT. First we need another folder to download some stuff. Create it and navigate inside that folder.

  1. Download source from Git


git clone https://github.com/fishtown-analytics/dbt.gi        

2. Simply install it. No need to run optional command/s


cd db

python -m pip install --upgrade pip (optional)

pip install -r requirements.txt        

3. Wait for it to finish and check if its working


dbt --version        

You should get the version of DBT that installed on your windows system

See you again with some more stuff related to DBT...

To view or add a comment, sign in

Others also viewed

Explore content categories