If you have a MacBook with an M1 chip and have tried to get dbt up and running from the command line, you may have run into the error below:
After some searching of the interwebs, I found a solution that worked for me, tucked away in a GitHub issue, in a comment by from Mike Lanza (thanks Mike! none of the other mentioned workarounds worked for me ).
Here’s how you do it
Step 1: Set up your Terminal to use Rosetta.
Go to Applications > Utilities > Terminal (or go to whatever other Terminal app you use), right click, select ‘Get Info’ and then select ‘Open using Rosetta’ under the General options. Close the Get Info window.
Step 2: Open your Terminal and uninstall any versions of dbt you may have tried to install before.
I’m team Homebrew - run
brew uninstall dbt in the Terminal*. Then, if you run
which dbt you should get
dbt not found.
*Per @claire - you may also consider uninstalling Homebrew completely and reinstalling brew via Rosetta first.
Step 3: Create a python virtual environment and install dbt.
Full instructions here, but run these are the exact commands I ran in the Terminal:
python3 -m pip install --user --upgrade pip
python3 -m pip install --user virtualenv
python3 -m venv env
pip3 install dbt==0.19.0
pip3 install --upgrade pip
Step 4: Change your working directory, if necessary.
Step 5: Do whatever you need to do in dbt!
Step 6: Deactivate your virtual environment.
deactivate in the Terminal.
And that’s it! Hope this saves some time for anyone struggling through the same situation