Reputation: 2399
I am gettin following error while installing python3.7 on MacBook air m1 2020. I run the following command:
brew install [email protected]
The following error is thrown:
[email protected]: The x86_64 architecture is required for this software.
Error: [email protected]: An unsatisfied requirement failed this build.
My question is that "how can I install python3.7 on MacBook Air m1 using brew??
Upvotes: 23
Views: 32675
Reputation: 1953
Based on this article, you may install Rosetta 2 to be able to use brew x86, and then use it to install python 3.7.
To install Rosetta 2:
softwareupdate --install-rosetta
Then, install brew x86 version:
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Optionally, add an alias to the ~/.zshrc
(or similar) file:
alias ibrew="arch -x86_64 /usr/local/bin/brew"
Now you can choose between brew
when you want to install an ARM app or ibrew
when you want to install x86 app.
Finally, to install x86 python 3.7 on M1:
ibrew install [email protected]
Upvotes: 50