# Notebooks

Notebooks are a built-in integration of [Jupyter Notebooks](https://jupyter.org/) on Data Platform. Coming with pre-loaded packages for data science, they allow you to perform non-real-time interactive statistical analysis and data visualization. Notebooks are highly connected to the rest of your Project, making it possible to read/write data in the Lakehouse Manager thanks to [our SDK](/en/technical/sdk/dpe/index) or convert your notebook code into a [Data Processing Engine](/en/product/dpe/index) action.

![notebooks](picts/jupyterlab.png)

* [Create a Notebook](#create-a-notebookcreate-a-notebook)
  * [Notebook Dependencies](#notebook-dependencies)
  * [Types of Dependencies](#types-of-dependencies)
* [Notebook Resources](#notebook-resources)
* [Open a Notebook](#open-a-notebook)
* [Export a notebook as a custom action](#export-a-notebook-as-a-custom-action)

---
## Create a Notebook

To create a notebook instance, head to the **Notebook** section of the [Data Processing Engine](/en/product/dpe/index.md).

![notebooks](picts/main-page.png)

To get started, click on **New notebook** in the top-right.

![notebooks](picts/create1.png)

You have to choose a [container image](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html) for your Jupyter environment, i.e. the set of packages and dependencies you want to have for your new notebook. Data Platform features two ready-to-run images which contain the most popular libraries for data analysis and data science. 

- **Base Notebook:** Provides a clean Python 3.13 environment with no pre-installed scientific packages, ideal for a minimal setup where you install your own specific packages.

- **PySpark Notebook:** Designed for data science and big data tasks, including Python 3.13, popular libraries (pandas, numpy, scikit-learn, etc.), Apache Spark, and additional utilities.

- **Data Science Notebook:** Includes Python 3.13 with popular data analysis, visualization, and machine learning libraries pre-installed (pandas, numpy, matplotlib, scikit-learn, etc.), ideal for general data science workflows.

- **Tensorflow Notebook:** Builds on the Data Science Notebook by adding TensorFlow and deep learning dependencies, ready for AI and neural network model development.

Choose the notebook that best fits your project’s needs. Once you've made your selection, your notebook will be ready to use.

>  If you are new to creating notebooks, we recommend starting with a **Base notebook**. This provides a clean, lightweight Python installation with minimal dependencies, allowing you to install only the specific packages you need.

![notebooks](picts/create2.png)

You can then configure your notebook further before it is created. Once you press **Create**, the server for the notebook will be initialized with its specific environment and dedicated computing resources.

![notebooks](picts/create3.png)

1. **Notebook Name Field** – Enter the name of the new notebook.
2. **Add Dependencies** – Click this button to add additional dependencies for the notebook.
3. **Instance Size Selection** – Choose the required instance size (DPU) for the notebook.
4. **Create Button** – Click this to create the new notebook after filling in the details.

The two main aspects to configure are:
* [Dependencies](#notebook-dependencies)
* [Instance Size](#notebook-resources)

---
## Notebook Dependencies

Your notebook's image already comes with some default packages, which you can check in the image description in the marketplace. 

![notebooks](picts/scipy-notebook.png)

You can specify additional dependencies by clicking on the **Add** button in the *Dependencies* panel.

![notebooks](picts/add-dep1.png)

Simply choose the type of dependency and enter the name of the package to install in the server.

![notebooks](picts/add-dep2.png)

You can add several packages at once by pressing *Enter* every time, like tags.

![notebooks](picts/add-dep3.png)

### Types of Dependencies

There are two types of dependencies:
- **Python dependencies:** You can install any package, such as pandas or numpy.
- **Data Platform dependencies:** You can choose from a list of available packages managed by the Data Platform.

You can only use one type of dependency per notebook instance. Mixing both types within the same notebook is not allowed.

!> **Important:** If you attempt to add or modify dependencies while a notebook is running, these changes will not take effect immediately. You must restart the notebook for the new dependencies to be applied. To restart, click the 'Stop' button to shut down the notebook instance, and then click 'Start' to relaunch it with the updated dependencies. Any unsaved work may be lost during this restart process, so be sure to save your work beforehand.
>
> If you need to install a dependency while your notebook is running, you can do so directly from the terminal within the JupyterLab environment. However, such installations are temporary and will not persist if the notebook is stopped and restarted. For permanent dependency additions, always use the "Add Dependencies" panel and restart your notebook.

---

## Open a Notebook  

Notebook instances are **automatically turned on** when you open them.  

The notebook instance will consume [all assigned DPU](/en/product/billing/resources/index) for the duration it is turned on.  

![notebooks](picts/turn-on.png)  

You can manually turn off a notebook by clicking on the *Stop* button when it is active.  

![notebooks](picts/turn-off.png)  

To open a notebook, **double-click** on it or press the button shown below. This will open the notebook in a new JupyterLab window.  

![notebooks](picts/open.png)  

Starting up a notebook might take anywhere between **3-5 minutes**, and up to **10 minutes** for the first time.  

The [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/) interface allows you to work on your notebooks with all the features provided by Jupyter, such as having multiple *.ipynb* files open at the same time, keyboard shortcuts, download and export options, and much more.  

Every notebook also ships with the [Data Platform Extension](/en/product/dpe/notebooks/data-platform-extension.md): a side panel to browse your datasets and buckets, run read-only SQL queries, create ready-to-use notebooks wired to your own data, and [export a notebook as a custom action](#export-a-notebook-as-a-custom-action). The [marimo](https://marimo.io/) notebook environment is preinstalled in all images as well.

> Use the Data Platform SDK to easily interact with the rest of your Project, typically to **import/process/export data** from and to your [Lakehouse Manager tables](/en/product/lakehouse-manager/tables/index).  

![notebooks](picts/jupyterlab.png)

---
## Export a notebook as a custom action

Once your notebook code is ready to run as a job, the [Data Platform Extension](/en/product/dpe/notebooks/data-platform-extension.md?id=export-a-notebook-as-a-custom-action) can turn it into a [Custom action](/en/product/dpe/actions/custom/index.md) without leaving JupyterLab: the action is created from your notebook's code, and the **pip installs** found in your notebook are automatically converted into the action's dependencies. See the extension page for the full flow.

---

### Need help? 🆘

> If you are logging-in with an OVHcloud account, you can create a ticket to raise an incident or if you need support at the [OVHcloud Help Centre](https://help.ovhcloud.com/csm/fr-home?id=csm_index). Additionally, you can ask for support by reaching out to us on the Data Platform Channel within the [Discord Server](https://discord.com/channels/850031577277792286/1163465539981672559). There is a step-by-step guide in the [support](/en/support/index.md) section.