Tutorial 2: Installing Jupyter Notebook on your local computer

Site: IHE DELFT OPENCOURSEWARE
Course: PyWaPOR OpenCourseWare
Book: Tutorial 2: Installing Jupyter Notebook on your local computer
Printed by: Guest user
Date: Friday, 26 December 2025, 6:51 PM

Description

For running pywapor locally on your laptop, you need to install Python program and install pywapor package in your python environment. This can be done in several ways, however, we recommend you use Mamba package manager, because it is fast, robust, and cross-platform. 

1. Installing Jupyter Notebook

In the next subchapters you'll learn to:

  • Install Mamba
  • Access the Miniforge prompt
  • Create a Python environment
  • Use Jupyter Lab

2. Install Mamba and access the Miniforge prompt

Install Mamba and access Miniforge

A package manager is a tool that allows you to manage the dependencies for your project that are not part of the Python standard library. Dependencies are code that is required for your program to function properly, often in the form of packages. For these exercises we will be using Mamba.

We will go through the following steps:

1. Download the Miniforge installer for Windows from the official Miniforge GitHub repository.

2. Install Miniforge. Follow the instructions (next page adapted from this excellent tutorial by Christian Mills).

3. Create pyWaPOR environment

On Windows we use Mamba through the Miniforge prompt, which is a command-line interface for interacting with conda environments.

Note

Pip is the most popular package manager for Python, which can install packages from many sources. The Python Package Index, PyPI, is the primary source. Although Pip is fine for general Python computing, it is preferred to use package managers that can create isolated environments that can be used to manage dependencies for different projects. Conda is the most popular one. A newer package manager is Mamba, which is faster than conda.

2.1. Installing and setting up Mamba

  1. Download the Mambaforge installer for Windows from the official Miniforge GitHub repository. Or through this direct link
  2. Run the installer executable.
  3. Follow the on-screen instructions in the setup window.
    1. Click the Next > button in the setup window
    2. Click the I Agree button to accept the license agreement.
    3. Select Just Me for the installation type and click the Next > button.
    4. Stick with the default install location and click the Next > button.
    5. Check the box to clear the package cache upon completion under installation options and click the Install button to start the installation process. 
  4. Wait for the installation process to complete, then click the Next > button.
  5. Finally, click the Finish button to close the setup window.

2.2. Accessing the Miniforge Prompt

On Windows, we use Mamba through the Miniforge Prompt. It is a dedicated command-line interface for interacting with conda environments.

Type “Miniforge Prompt” into the Windows search bar and click Open.


windows-search-miniforge-prompt

A new command prompt will open at the location of your Windows user folder.

miniforge-prompt-new

The text in front of the current directory path indicates the name of the current conda environment.
miniforge-prompt-new

We can get a list of the available conda environments and their locations using the following command:

mamba env list

mamba-env-list

The only one listed is “base.” When Mambaforge is installed, the folder miniforge3 is created in c:/users/personal. Inside it, the folder “envs” can be found. Mambaforge will store any conda environments we create in the “envs” folder.

3. Create a Python environment

Before setting up a new Python environment, let's review the advantages of virtual environments and why they are crucial for Python projects (from Christian Mills tutorial).

  • Isolation of Dependencies: Virtual environments create isolated spaces for each project, allowing developers to install and manage different package versions without conflicts. This isolation ensures that the specific dependencies required for one project do not interfere with or break the dependencies of another project.
  • Easier Project Management: Virtual environments help streamline project management by maintaining separate configurations for different projects. Developers can replicate or share project environments with team members, ensuring consistent behavior across various machines. Shareable project environments help developers collaborate, troubleshoot, and deploy projects.
  • Simplified System Maintenance: Using virtual environments helps developers avoid cluttering their system-wide Python installation with numerous packages and varying versions. System maintenance is cleaner as developers can easily add, update, or remove packages within individual project environments without affecting other projects or the system as a whole.

3.1. Create pyWaPOR environment

To install the pyWaPOR environment, go to your Miniforge Prompt and type

mamba create -n pywapor_env pywapor jupyterlab geopandas gdal xarray rioxarray

Once the prompt below popped up, type Y then ENTER to confirm installing new environment


After mamba finished downloading and installing, activate the environment by typing

mamba activate pywapor_env
 

To start jupyter lab type:

jupyter lab

With this command, you will open Jupyter Lab in your web browser application. See below for an example of JupyterLab interface and the explanation of its components.

Jupyter Lab user interface
(© Copyright CodeRefinery team)

Now, you're ready to go to the next step Tutorial 3: Setting up pyWaPOR for your own case study, in which you will create your first Jupyter notebook to run pywapor!

------------------------------------------------------------------------------------------------------------------------

If you're interested in more examples of Jupyter notebooks, follow this link More tutorials using Jupyter Notebooks.

4. More tutorials using Jupyter Notebooks

If you want to try more things out then follow the course on Python for hydrological applications, which includes applications such as:

  • Spatial interpolation of borehole data
  • Stream and Catchment Delineation

Dont forget to install the correct environment for running these examples.