-! 🚨 WARNING 🚨 !-
This is not for the faint of heart - and you should avoid using old versions if possible.
If you have dbt
installed globally on your machine (e.g. via brew) - you probably want to remove it (e.g. brew remove dbt
).
The following steps were tested on macOS 12.1
(non M1) with Python 3.8.7
.
- Clone the dbt-core repo.
mkdir ~/src && cd ~/src
git clone https://github.com/dbt-labs/dbt-core.git
I'm cloning into my home directorys' src
folder but you can choose to clone this somewhere else.
- Checkout the
0.14.latest
branch.
cd ~/src/dbt-core
git checkout 0.14.latest
- Remove the
psycopg2
requirements from the postgres and redshift pluginsetup.py
files. We're going to install thepsycopg2-binary
package instead.
sed -i.bak '33d' plugins/postgres/setup.py
sed -i.bak '34d' plugins/redshift/setup.py
I'm using sed
to delete line 33 in the plugins/postgres/setup.py
file and line 34 in the plugins/redshift/setup.py
file but you can just open those files up in a text editor and delete them instead.
- We're ready to install dbt with Python's pip.
Check that we have the right Python version (this will not be covered by this guide - you can try other Python versions but I can't guarantee that it will work).
python --version
Python 3.8.7
Create a Python virtual environment (and then activate it) to isolate our installation.
python -m venv venv
source venv/bin/activate
I'm creating a virtual environment with the name venv
but you can choose to call it whatever you want (e.g. venv_dbt_0.14
).
Update pip.
python -m pip install --upgrade pip
Install psycopg2-binary
, the dbt
cli application, and specific versions of supporting packages.
pip install psycopg2-binary
pip install -r requirements.txt
pip install Jinja2==2.10.1
pip install MarkupSafe==2.0.1
Check your installed dbt version.
dbt --version
installed version: 0.14.4
latest version: 1.0.0
Your version of dbt is out of date! You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation
- When you no longer want to be in this virtual environment where
dbt 0.14
is available as a cli application, simply deactivate it (and reactivate viasource
it if you do - see above).
deactivate