Run Demo Notebooks outside of Binder

If you’re running this on Binder, ignore this guide. The Binder environment has all dependencies and data files pre-installed.

If you’re running in another environment, you need to install some dependencies and download data files.

The following steps assume you have a Jupyter Notebook environment. If you don’t, please install Anaconda.

Download/Clone this repository

You may use Git to clone this repository in the command line.

git clone https://github.itap.purdue.edu/xiao253/dask-demo.git

Then, change into the new directory that contains the repository.

cd dask-demo

Alternatively, navigate to this repository on GitHub, click on the green Code button, then click Download ZIP. Extract the ZIP file after the download completes.

Download ZIP

Then, open a terminal in the new directory that contains the repository.

Create a new Conda environment

The demo notebook uses the following Python dependencies:

dask==2021.6.0
dask-core==2021.6.0
distributed==2021.6.0
hvplot
ipywidgets
matplotlib
netcdf4
xarray

If this is your first time using Dask, you need to install these packages. You only need to do it once.

conda env create -f environment.yml

A new environment named dask-demo will be created with all dependencies installed. This process can take several minutes.

Activate the new environment

conda activate dask-demo

Add the new environment to Jupyter Notebook

First, you need to install ipykernel with conda.

conda install -c anaconda ipykernel

After installing, add the new environment to Jupyter Notebook

python -m ipykernel install --user --name=dask-demo

Download data files

The demo notebooks expect data files in data folder. You should download all data files into that directory.

# Create data/
mkdir data

# Download all data files
wget --directory-prefix data -i download_list.txt

Open Notebook

In Jupyter Notebook, open a demo notebook as usual. When prompted to select a kernel, select dask-demo from the list.

Kernel not found prompt

If you aren’t prompted to select a kernel, you can select one manually. Go to Kernel (on the top menu bar) -> Change kernel -> select dask-demo from the list.

Change kernel