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: https://conda.io/docs/user-guide/install/windows.html
  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: https://chocolatey.org/

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
1 Like

I’ve actually taken some steps along this thread and ran into a few things to keep in mind:

  • permission your dbt project directory with everything (chmod -R 777 /dbt_project) - trust me, you’ll need it.
  • trying to find a good way to keep my ~/.dbt folder in sync and permissioned across both systems like when I add new databases but need to do in two places? I guess overriding the profiles.yml location is an option.