Jupyter Notebook and JupyterLab Overview

Jupyter Notebook is a web application for creating and sharing computational documents. This application can be used to create and share documents that contain live code, equations, visualizations, and text

Accessing Jupyter Notebook and JupyterLab

To access a Jupyter Notebook or JupyterLab environment, visit the URL provided by your instructor (or jupyter.davidson.edu.) Chrome and Firefox are the only supported browsers.

Log in using your full Davidson email credentials (username@davidson.edu), and password. If you are able to log into a lab computer, you also have access to Juypter. 

After your credentials are verified, an instance will be created, and a blue progress bar will be displayed as your server starts up.

 

mceclip1.png

 

The Default Jupyter Interface

The menu bar at the top of JupyterLab has menus that expose actions available in JupyterLab along with their keyboard shortcuts. The default menus are:

  • File: actions related to files and directories
  • Edit: actions related to editing documents and other activities
  • View: actions that alter the appearance of JupyterLab
  • Run: actions for running code in different activities such as notebooks and code consoles
  • Git: source code version control related actions
  • Tabs: a list of the open documents and activities in the dock panel
  • Settings: common settings and an advanced settings editor
  • Help: a list of JupyterLab and kernel help links

mceclip2.png


On the top right corner is an indicator of the CPU and the memory usage (in 5-second updates):

mceclip3.png

The CPU monitor will show CPU usage blue>yellow>red, where red represents approaching the usage threshold. If you exceed the memory threshold, the notebook will shut down.

Additionally, a memory monitor is located at the bottom of the screen with a numerical depiction of memory usage.

mceclip4.png

On the left-hand side of the screen is a sidebar that provides more information:

  • File Browser: The file browser and File menu enable you to work with files and directories on your system. To download from within the file manager, right-click Download as an Archive (.zip, extraction software default on lab machines). 
  • Running Terminals and Kernels: A list of tabs in the main work and of running kernels and terminals.
  • GIT: An interface for making and staging commits while working in a version-controlled directory. 
  • Table of Contents: An overview (and structure) of the currently active document.
  • Extension Manager: Management of third-party extensions.
    • Installed: shows currently installed extensions   
    • Discover: searches among available extensions for installation


Installation of Packages and Kernels

 

How to install python packages

To install a package in the default environment for your user (which lives in the folder "~/.local")

  • Open a terminal, then based on the desired package version: 
    • For the latest version of the package run: 
$ pip install –user "package"
    • For a specific version (say "x.y.z") of the package run:
$ pip install --user "package==x.y.z" 
  • If you are trying to use the package in an active notebook, you will need to restart the kernel for that notebook.

To install the package in a virtual environment you created, then you will first need to activate that environment and follow the same instructions as above.

 

How to add a custom python notebook kernel

To create a python notebook kernel for your instance, do the following:  

  • Create a virtual environment with required packages and python installed (available methods: venv, mamba, pipenv, conda, virtualenv; recommended method: mamba).
  • With the virtual environment activated, install the `ipykernel` python package.
    • If using virtualenv, venv, you do this by running:
$ pip install "ipykernel"
    • If using mamba, you do this by running:
$ mamba install ipykernel 
    • finally, when using conda, you do this by running,
$ conda install ipykernel
  • Again, with virtual environment activated, make the python kernel for the environment available to JupyterLab by running the following command: (substituting “env-name” with the name of your environment or project.)
$ python3 -m ipykernel install --user --name "env-name" --display-name "Python [env-name]" --env PYTHONPATH ""
  • Refresh your browser window.
  • After the webpage finishes loading, a python notebook kernel with the name "Python [env-name]" will appear in the Launcher tab.
      

For Support Issues

Students
For any student support needs please email ti@davidson.edu. 

Faculty
For most Juypter support needs, please email ti@davidson.edu. 

Request Help