macOS Local Python Environment Installation Guide

Within this guide, we will walk you through the steps to setup the bootcamp environment on your local computer that is running macOS.

Installing Xcode Command Line Tools (Xcode CLI)

Video depicting the steps to install Xcode Command Line Tools (Xcode CLI)

First, we need to install Xcode CLI developer tools by:

  1. Opening Terminal
    • Found under Applications -> Utilities -> Terminal.app;
    • Or, by typing in “Spotlight” in the upper right-hand corner Terminal.
  2. Once Terminal is open type:
sudo xcode-select --install
  1. This will trigger an installation pop-up. Please follow the installer prompts.

  2. To verify the success of the installation, type into Terminal:

git --version

Setting up Git

While in Terminal, setup git by typing:

git config --global user.name "FirstName LastName"
git config --global user.email netid@illinois.edu

where FirstName and LastName correspond to your full name and netid@illinois.edu should be your Illinois e-mail address.

Installing Miniconda 3

Video depicting the steps to install Miniconda 3 on macOS

Second, we need to download Miniconda 3 from: https://docs.conda.io/en/latest/miniconda.html

  1. Choose the “Miniconda 3 MacOSX 64-bit pkg” option.
  2. Open the downloaded installer.
  3. Follow the steps to completion.
  4. Open Terminal
    • Found under Applications -> Utilities -> Terminal.app;
    • Or, by typing in “Spotlight” in the upper right-hand corner Terminal.
  5. Ensure that conda was installed correctly and is up-to-date by typing:
conda update -n base -c defaults conda

Note: Some students are reporting that the conda is not found.

Please open Terminal and type:

touch ~/.zshrc
# Add bash_profile 
echo "source ~/.bash_profile" >> ~/.zshrc

The first line creates the .zshrc file in the home directory (~/) and the second line adds a link to the .bash_profile code.

Then, in Terminal type:

source ~/.zshrc

Installing the pre-defined Inmas Bootcamp environment

With the software prerequisites done, we move onto to setting up a custom conda environment for the bootcamp.

We will use a requirements.txt to pre-specify python packages required for the workshop. You can download a copy by clicking:

Requirements: inmas.yaml

The contents of the file is viewable at the end of the post.

On macOS, please open Terminal again, and type:

# Download
curl -Os https://inmas-training.github.io/inmas-bootcamp/inmas.yaml

Next, we will download and install the predefined environment for the bootcamp by typing:

# Create an environment called "inmas" with packages installed.
conda env create -f inmas.yaml

Python Environment Details

Contents of the Inmas environment file: inmas.yaml

name: inmas
channels:
- defaults
- pytorch
- conda-forge
dependencies:
- python=3.9
- pip>=21.0
- tensorflow=2.4
- pytorch=1.9
- torchvision
- torchaudio
- scikit-learn
- scipy
- statsmodels
- typing
- requests
- pyyaml
- pandas
- pandas-datareader
- imageio
- pillow
- librosa
- h5py
- tqdm
- matplotlib
- seaborn
- bokeh
- jupyter
- boto3
- pip:
  - gym
  - gradio