I’m always using the Homebrew to install the dependencies needed. For recent studies, I need Anaconda for learning python developments. So the first step is trying to install Anaconda with homebrew via
brew cask install anaconda, but get this warn information while installing:
Cask anaconda installs files under /usr/local. The presence of such files can cause warnings when running "brew doctor", which is considered to be a bug in Homebrew-Cask.
To fix this bug, you need to add the
/usr/local/anaconda3/bin directory to the PATH environment variable. Simply run this command in terminal if you’re using bash:
echo 'export PATH="/usr/local/anaconda3/bin:$PATH"' >> ~/.bash_profile
or, if you use zsh instead of bash, command like this:
echo 'export PATH="/usr/local/anaconda3/bin:$PATH"' >> ~/.zshrc
Then, full restart terminal and run:
# or... if you're using zsh
# conda init zsh
conda init is available in conda versions 4.6.12 and later.
Anaconda will configure the environment automatically for you. Example of configurations on my Mac looks like this after execute the above command:
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/usr/local/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
if [ -f "/usr/local/anaconda3/etc/profile.d/conda.sh" ]; then
# <<< conda initialize <<<
I would highly recommend you to use zsh to get a more interactive terminal interface, read this post for setting up zsh. On newer macOS such as bigSur, zsh is now the default shell application.
The same works for
miniconda. If you installed it using Homebrew with
brew cask install miniconda, you need to set source of the PATH to
.zshrc, for example.
echo 'export PATH="$PATH:/opt/miniconda3/bin"' >> ~/.zshrc
Then, still in a zsh shell:
miniconda will set responding configs automatically. After that, you can comment out the
export PATH="$PATH:/opt/miniconda3/bin" in
If you run
conda update --all for the first time, it may warn:
Verifying transaction: - WARNING conda.core.path_actions:verify(962): Unable to create environments file. Path not writable.
environment location: /Users/<username>/.conda/environments.txt
To fix this issue, we can change the ownership of the above directory with:
sudo chown -R $USER ~/.conda
If you come across other issues, please leave your comments below…