-
Install Xcode from Apple App Store
-
Download and install Xcode Command Line Tools:
xcode-select --install
/bin/bash -c "$(curl -fsSL https://github.com/raw/Homebrew/install/HEAD/install.sh)"
In ~/.zprofile:
eval "$(/opt/homebrew/bin/brew shellenv)"
alias abrew='arch -arm64 /opt/homebrew/bin/brew'
alias ibrew='arch -x86_64 /usr/local/bin/brew'
export PATH="/opt/homebrew/bin/git:${PATH}"
brew install pyenv
brew install pyenv-virtualenv
Need to configure ~/.zshrc, ~/.bash_profile or ~/.zprofile.
In ~/.zshrc:
eval "$(pyenv init -)"
source ~/.zprofile
source ~/.bash_profile
In ~/.bash_profile:
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi
In ~/.zprofile:
export PYENV_ROOT="$HOME/.pyenv"
eval "$(pyenv init --path)"
Then:
pyenv install miniforge3-4.10.1-5
pyenv shell miniforge3-4.10.1-5
conda create --name tensorflow-macos python=3.9.5
conda activate tensorflow-macos
conda install -c apple tensorflow-deps
pip install tensorflow-macos
pip install tensorflow-metal