Install miniforge
brew install miniforge
Initialize miniforge
conda init "$(basename "${SHELL}")"
Create the environment for tensorflow on M1 Mac
conda create --name m1_tensorflow python=3.8
Activate the environment
conda activate m1_tensorflow
Install dependencies for tensorflow
conda install -c apple tensorflow-deps
Install base tensorflow
python -m pip install tensorflow-macos
Install tensorflow-metal plugin (it's used when you have GPU)
python -m pip install tensorflow-metal
Install matplotlib
conda install matplotlib
TIPS: recommend to use conda install to install packages instead of pip install as long as you can.