Skip to content

Install Mamba, Python, and Jupyter Lab: Windows User

  • Go to Miniforge Website.

  • Open Miniforge page, download and execute the Windows installer.

  • When asked about the Installation Type: Choose 'Just Me'

  • Follow the default settings for the Advanced Installation Option.

  • After installing Miniforge, open the Miniforge Prompt

  • Test if Mamba and Conda have been successfully installed by entering the following in Miniforge Prompt.

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.12 jupyter jupyterlab notebook numpy scipy ipython pandas matplotlib cartopy geopandas xarray dask netCDF4 seaborn statsmodels pooch

This will take several minutes. Mamba has to work out a set of package versions that all fit together before it downloads anything.

  • After it's finished, activate the environment:
mamba activate esa_env

Your prompt should now start with (esa_env). You will need to run mamba activate esa_env every time you open a new Miniforge Prompt to work on this course.

Launch Jupyter Lab

  • Invoke Jupyter Lab and specify the directory (e.g., if your course folder is located at E disk, specify it as E:/):
jupyter lab --notebook-dir=E:/
  • You should see the 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, you should see the directory of the disk on the left. Browse through the content and enter your course folder by clicking on it.

  • 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'

Test your installation

  • 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()

You should see a colored map of air temperature. If you do, everything you need for this course is installed.

If something goes wrong

  • mamba is not recognized — you are in the ordinary Command Prompt or PowerShell instead of the Miniforge Prompt. Open the Miniforge Prompt from the Start menu.
  • ModuleNotFoundError on one of the imports — you are probably running a notebook that is not using esa_env. Check the kernel name in the top right of the notebook, and make sure you launched jupyter lab from a prompt where (esa_env) was showing.
  • Jupyter Lab cannot see your course folder — the drive letter in --notebook-dir= does not match where your folder actually is. Check the path in File Explorer and use that drive letter.
  • The mamba create step fails or hangs on "solving environment" — check your internet connection and run it again. If it still fails, bring the error message to office hours.

Submit

  • Submit this Jupyter Notebook as your assignment. It must show the package imports and the xarray plot.