Skip to content

Install Mamba and Python: Mac User

  • Open Terminal (Launchpad -> Other -> Terminal)

  • Install Miniforge using:

curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3-$(uname)-$(uname -m).sh
  • Install Mamba on your laptop:
    Agree license term: yes 
    Confirm install location: ENTER
    Do you wish to update your shell profile to automatically initialize conda: yes
  • Close terminal window, and reopen a terminal window. Test if Mamba and Conda have been successfully installed
mamba

You should see

conda is a tool for managing and deploying applications, environments and packages. 
....
  • In the terminal, create a new environment esa_env:
mamba create -n esa_env python=3.9 jupyter jupyterlab notebook numpy scipy ipython pandas matplotlib cartopy geopandas xarray dask netCDF4 seaborn statsmodels pooch
  • After it's finished, activate the environment:
mamba activate esa_env
  • Invoke Jupyter Lab:
jupyter lab
  • You should see Jupyter lab page automatically opened in your web browser. If not, copy and paste one of the URLs listed to your web browser.

  • In the Jupyter Lab, go to File -> Open from Path. Enter the path of your course folder.

  • If you don't know the folder path, find the folder in Finder, right click on the folder, press Option, and click Copy "environmental_science_analysis" as Pathname.

  • Once you're at your course folder, open a new Jupyter notebook by clicking the + sign. Choose Notebook.

  • Rename the Notebook to be 'Lecture_2_Install_Python.ipynb'

  • Enter the following code in the Notebook to test if you successfully installed all necessary packages:

import xarray as xr
import pandas as pd
import geopandas as gpd

If no errors, enter the following to test the plotting functions:

ds = xr.tutorial.load_dataset("air_temperature")
ds.air[0,:,:].plot()

-Submit this Jupyter Notebook as your assignment.