Installing dbt with Mac M1 Chips

Data

Installing dbt with Mac M1 Chips

//

Have you encountered errors trying to install older versions of dbt on your fancy, new MacBook? This could be related to compatibility issues with the new M1 CPU. Dependency packages written for Intel CPUs can cause issues preventing proper installation. But don’t worry, Apple provides an Intel emulator called Rosetta. Below are the steps that worked for me.

Before we go through our instructions, please note that I am installing dbt 0.20.2 as my example. Your results may vary depending on the version you need. Also be aware that I found this process successful with CLI dbt, but still encounter issues with virtual environments, like “dbtevn.”

With those notes in mind, here are the steps I recommend:

  1. Start by referencing the dbt Install Documentation. dbt includes specific instructions for installation on an M1 Mac. There are 2 important considerations to take note from this documentation:
    1. We need to run our commands through Rosetta to emulate an Intel chip. 
    2. We will also follow the pip install instructions instead of brew as we will have to be careful about our Python version to match the old dbt version’s requirements.

  2. I found this guide to be most helpful in setting up a Rosetta terminal environment. It also shows you how to use that terminal environment directly in vscode. $uname -m is a helpful command to check if you are correctly emulating the Intel architecture. 
  3. I followed this guide to set up Python. I specifically followed pyenv instructions as Python versioning is important to the necessary dependencies. I install Python 3.9.7 as that was the most recent version when dbt v0.20.2 was deployed.
  4. Pip install dbt using your Rosetta terminal. Here are the dbt docs for reference.
  5. I had to downgrade the MarkupSafe dependency package.
  6. Don’t forget to set up your profiles.yml file in the .dbt root directory. 
  7. Here is one other guide for reference that doesn’t use pyenv

At this point you should be able to run dbt successfully from the CLI. I hope this helped you overcome some of the challenges I ran into.

More About the Author

Austin Schwinn

Data Engineer
Snowflake Masking Policies Demystified Organizations are constantly collecting and analyzing vast amounts of sensitive information. Protecting this data has become more ...
Installing dbt with Mac M1 Chips Have you encountered errors trying to install older versions of dbt on your fancy, new MacBook? This could be related to compatibility ...

See more from this author →

InterWorks uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy. Review Policy OK

×

Interworks GmbH
Ratinger Straße 9
40213 Düsseldorf
Germany
Geschäftsführer: Mel Stephenson

Kontaktaufnahme: markus@interworks.eu
Telefon: +49 (0)211 5408 5301

Amtsgericht Düsseldorf HRB 79752
UstldNr: DE 313 353 072

×

Love our blog? You should see our emails. Sign up for our newsletter!