How To Install and Configure Miniconda on a Mac M1

1

Check if you have conda installed

conda --verison
2

Create the Miniconda3 directory.

mkdir -p ~/miniconda3
3

Download the Miniconda3 installer.

curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh -o ~/miniconda3/miniconda.sh
4

Install Miniconda3 silently.

bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
5

Remove the Miniconda3 installer.

rm ~/miniconda3/miniconda.sh
6

Print the current shell.

echo $SHELL
7

Change to the Conda bin directory.

cd ~/miniconda3/bin/conda
8

Change to the Miniconda3 bin directory.

cd ~/miniconda3/bin
9

Initialize Conda for the Z shell.

conda init zsh
10

Check the Conda version again to see if its installed

conda --version
11

According to the FAQ, what you should do in case conda was not set up correctly is not to modify the PATH variable manually, but instead try to activate the environment in the terminal by entering the below command.

source <path to conda>/bin/activate like source ~/miniconda3/bin/activate
12

To not source everytime you start a new shell, add this to your ~/.bashrc or ~/.zshrc

export PATH="/Users/<username>/miniconda3/bin:$PATH"
13

Initialize conda with shell name zsh or bash, for MAC its zsh

conda init zsh