Install Python on Mac (Anaconda)

Michael Galarnyk
3 min readDec 26, 2016

--

While I previously made a video on how to manually install anaconda, the way below utilizes bash scripts which are a faster way to install a Python 3 or Python 2 version of Anaconda. If you aren’t sure which Python version you want to install, choose Python 3. Do not choose both. You can always work in Python 2 if you install a Python 3 Version of Anaconda if you want (you can learn more here).

Bash Script Installation (Python 3 Version)

  1. Open a terminal. You can do this by clicking on the Spotlight magnifying glass at the top right of the screen, type terminal and then click on the Terminal icon.
Open a terminal

2. Paste the script below into your terminal.

# Go to home directory
cd ~
# You can change what anaconda version you want at
# https://repo.continuum.io/archive/
curl https://repo.continuum.io/archive/Anaconda3-5.1.0-MacOSX-x86_64.sh -o anaconda3.sh
bash anaconda3.sh -b -p ~/anaconda3
rm anaconda3.sh
echo 'export PATH="~/anaconda3/bin:$PATH"' >> ~/.bash_profile
# Refresh basically
source .bash_profile
conda update conda

Keep in mind that you can update the version of Anaconda in this bash script by going to the Anaconda installer archive and updating the curl command with the appropriate .sh file.

3. A good way to test your installation is to open a jupyter notebook. You can do that by typing the command below into your terminal. You can also see the command in action here.

jupyter notebook

Bash Script Installation (Python 2 Version)

  1. Open a terminal. You can do this by clicking on the Spotlight magnifying glass at the top right of the screen, type terminal and then click on the Terminal icon.
Open a terminal

2. Paste the script below into your terminal.

# Go to home directory
cd ~

# You can change what anaconda version you want at
# https://repo.continuum.io/archive/
curl https://repo.continuum.io/archive/Anaconda2-5.1.0-MacOSX-x86_64.sh -o anaconda2.sh
bash anaconda2.sh -b -p ~/anaconda2
rm anaconda2.sh
echo 'export PATH="~/anaconda2/bin:$PATH"' >> ~/.bash_profile

# Refresh basically
source .bash_profile

conda update conda

Keep in mind that you can update the version of Anaconda in this bash script by going to the Anaconda installer archive and updating the curl command with the appropriate .sh file.

3. A good way to test your installation is to open a jupyter notebook. You can do that by typing the command below into your terminal. You can also see the command in action here.

jupyter notebook

Further Steps (Optional)

If you aren’t sure what to do after installing Anaconda, here are a few things you can do:

  • If you would like to learn more about Anaconda to install libraries, you can learn about more here.
  • If you want to learn how to utilize the Pandas, Matplotlib, or Seaborn libraries, please consider taking my Python for Data Visualization LinkedIn Learning course.
  • If you would like to learn how to use Jupyter and Python, you learn more here.
  • If you want to install and learn about Git, you can check out this tutorial.

If you any questions, feel free to reach out in the comments below or through Twitter.

--

--