Feel free to explore the widget list and use any that would help in showcasing your code project. For example, buttons, text boxes, sliders, progress bars, and more. Ipywidgets is a module that lets us create interactive widgets in Jupyter notebooks. Step Two: Create Interactive Web Elements with Ipywidgets Time to load the web app with some sliders and buttons.
#!jupyter serverextension enable voila -sys-prefix #!jupyter nbextension enable -py widgetsnbextension -sys-prefix That will hide the displayed text from the previous cell execution from our web app. !jupyter serverextension enable voila -sys-prefixĬomment out the commands and execute the cell again. We need to enable the extensions to be properly displayed on the notebook: !jupyter nbextension enable -py widgetsnbextension -sys-prefix
Install three modules named widgetsnbextension, ipywidgets, and voila, as follows: $ pip install widgetsnbextension You will see it opened on your default web browser. Type the following command to open the Jupyter Notebook app: $ jupyter notebook Install the Jupyter Notebook app using either the conda or the pip package manager: $ conda install -c conda-forge notebook To create and activate a virtual environment, type the following commands: $ python3 -m venv venv_nameįigure 1: Clone a Git repository and activate a virtual environment. We will export the names and versions of all installed packages to a text file later as a requisite for Binder. It is always a good practice to isolate the required dependencies per project. Next, we are going to create a virtual environment for the code project. To clone a Git repo onto your local directory, type the following command on a terminal or command prompt: $ git clone For this tutorial, I have created a GitHub repo named jupyter_webapp_demo. That is because Binder will refer to it to create a Docker container that hosts our web application. It is unnecessary to push every coding project onto our Git repository.
Step One: Create A New Git Repository and Install Python Packages