Using Jupyter Notebooks on the Education Hub

NSF Unidata and the NSF Unidata Learning Program offer Jupyter Notebooks for learning. Jupyter Notebooks combine Python code with rich text and multimedia. To get started, install Python and follow the setup instructions that match your needs.

For Classroom Usage

Classrooms may request a JupyterHub from NSF Unidata to get multiple users access to notebooks without any installation required. 

Request a JupyterHub

 

Miniconda provides an easy way to install Python and the necessary dependencies for using Jupyter Notebooks.

  1. Download the Miniconda installer for your operating system from the Anaconda website.
  2. Follow the installation instructions provided by the installer.
    In the installer, ensure Create shortcuts is enabled.
  3. Set up the unidata-edhub Conda environment by following the instructions in the next section.
  4. To open a Jupyter Notebook after installing Python, follow the instructions in the relevant section below.

You only need to complete these steps once. The unidata-edhub environment is required for all resources on the NSF Unidata Education Hub.

  1. Download the environment.yml file and save it to a known location on your computer.
  2. Open a terminal (Linux or macOS) or Anaconda Prompt (Windows).
  3. Navigate to the folder where you saved environment.yml, for example:

    cd C:\Users\Owner\Documents\PythonEnvironments 
  4. Run the following command to create the environment: 

    conda env create -f environment.yml 

    This process may take several minutes.

Before you begin, make sure you know where the .ipynb file is saved. You may need to move it from your Downloads folder to a more convenient location. 

  1. Open a terminal (Linux or MacOS) or Anaconda Prompt (Windows).
  2. Activate the unidata-edhub environment: 

    conda activate unidata-edhub

    If you see the error EnvironmentNameNotFound: Could not find conda environment: unidata-edhub, follow the steps in the I need to create the unidata-edhub conda environment section.

  3. Navigate to the folder containing the .ipynb file, for example: 

    cd C:\Users\Owner\Documents\JupyterNotebooks
  4. Start Jupyter Lab: 

    jupyter lab

    Jupyter Lab opens in a new browser tab. 
    Important
    Keep the terminal or Anaconda Prompt window open while using Jupyter Lab.

  5. In Jupyter Lab, use the File Browser in the left sidebar to locate the .ipynb file. Double-click the file to open it.
  6. If prompted to select a kernel, choose Python [conda env: unidata-edhub].

Follow these steps to download and use a Jupyter Notebook from a GitHub repository. If the GitHub repository has its own special setup instructions, follow those instructions instead of the instructions below. 

Download and extract files 
  1. Open the GitHub repository in your web browser.
  2. Scroll to the README section. If the repository includes installation instructions, follow those instead of these steps.
  3. At the top of the page, select the Code button, then select Download ZIP.
  4. After downloading, extract the files to a known location on your computer. 

 

Open Jupyter Lab 
  1. Open a terminal (Linux or MacOS) or Anaconda Prompt (Windows).
  2. Activate the unidata-edhub environment: 

    conda activate unidata-edhub

    If you see the error EnvironmentNameNotFound: Could not find conda environment: unidata-edhub, follow the steps in the I need to create the unidata-edhub conda environment section.

  3. Navigate to the folder where you extracted the GitHub repository, for example: 

    cd C:\Users\Owner\Documents\JupyterNotebooks
  4. Start Jupyter Lab: 

    jupyter lab

    Jupyter Lab opens in a new browser tab. 
    Important
    Keep the terminal or Anaconda Prompt window open while using Jupyter Lab.

  5. In Jupyter Lab, use the File Browser in the left sidebar to locate the .ipynb file. Double-click the file to open it.
  6. If prompted to select a kernel, choose Python [conda env: unidata-edhub].

 

Are these instructions out of date? Please contact us.