Installing DBT on Windows

Installing dbt on Windows. This is one workflow that kinda-sorta worked for onboarding a less-technical analyst.

  1. Get admin privs
  2. Install anaconda for windows:
  3. Open anaconda terminal
  4. conda install -c conda-forge dbt
  5. Create a dbt.bat script in c:\ProgramData\Anaconda3\Scripts with the single line python c:\ProgramData\Anaconda3\Scripts\dbt %*

Potential alternatives to explore and document:

  1. Easy step-by-step install directions for non-anaconda Python.
  2. Dockerized dbt
  3. Create a chocolatey package:

Another alternative:

  • Set up Windows Subsystem for Linux
  • Install dbt for Linux on your WSL environment (worked on Ubuntu for me)

The main thing to be careful about is ensuring your dbt projects remain in the Windows parts of your filesystem, i.e. don’t put your projects/models in ~/. That way you can edit your models with whatever Windows text editor you like, and you can kick off dbt commands as normal within the WSL bash environment.

I believe it’s also possible to install pip within a conda environment:

So you’d run something like:

conda create -n my_env
conda activate my_env
conda install pip
pip install dbt