Chiming in here with my suggestions! (Thanks for the tag @roliepoly!)
First of all, if dbt is the only command line program you are having issues with, use Olya’s approach! It’s great!
I personally was finding that I had M1 issues on other programs installed via homebrew (pyenv, ruby, everything, gah!) that a python env wouldn’t solve, so I had to do something a little more drastic!
Here’s what I did:
-
Completely uninstalled homebrew, and all brew-installed programs
I can’t remember the exact instructions here, but think this was pretty google-able -
Relauched iTerm with Rosetta.
This is a way to use programs as though they are operating on an non-M1 Mac
To do this: right-click on iTerm, click ‘Get Info’, and check the ‘Open using Rosetta’ option. -
Reinstalled homebrew using my (Rosetta) iTerm
This let me install dbt without issues, and all my other programs
Granted, using this approach unilaterally means that I lose some of the speedups from the M1 chip, and some programs are compatible with the M1 chip.
If you want to take advantage of the M1 software where possible, some solutions on the internet also suggest that it’s possible to run a dual setup, so that you can install M1-compatible software on the M1 architecture, and then have a backup way to install non-compatible software (like dbt).
There are two main approaches to a dual setup, neither of which I could get to work, but you may be able to! I’ve included a conceptual overview of both for context
Option 1: Using two versions of iTerm (one using the M1 architecture, one using Rosetta):
To create your second iTerm app, copy your iTerm app, name it “iTerm rosetta” version, and launch it using Rosetta.
Then install homebrew from the iTerm Rosetta app, and any incompatible programs.
Default to using your standard iTerm app when installing programs, and use the iTerm Rosetta app when installing programs that have compatibility issues.
I copied the app successfully, but couldn’t get the two versions of homebrew to coexist.
Option 2: Using one iTerm application, but two versions of homebrew
To install the second version of brew (using Rosetta) use arch -x86_64
as a prefix to the installation command (source).
Then use that prefix again when installing programs with the old version of homebrew: arch -x86_64 brew install <package>
.
Default to using the standard brew command when installing programs, and use the prefixed brew command when installing programs that have compatibility issues.
Again, I couldn’t get this to play nicely, mostly due to pyenv
issues.
The issues I hit were to do with $PATH
variables, sourcing commands (esp. on pyenv
, a tool I use a lot) and all kinds of things that I hate debugging. A more patient person than me could probably get a dual architecture working! For now, I’m sticking with my Rosetta-only approach.