---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://ytsaurus.tech/docs/en/user-guide/data-processing/spyt/API/spyt-jupyter.md
  - https://ytsaurus.tech/docs/ru/user-guide/data-processing/spyt/API/spyt-jupyter.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ytsaurus.tech/docs/en/llms.txt

<!-- source: en/_includes/user-guide/data-processing/spyt/API/spyt-jupyter.md -->
# SPYT in Jupyter

## Setup { #prepare }

Before you can use Spark in Jupyter, you need to create a [cluster](https://ytsaurus.tech/docs/en/user-guide/data-processing/spyt/cluster/cluster-start.md). Currently working with Spark using Jupyter notebooks is possible only using inner standalone cluster.

If there is one already, you need to find out the values of `proxy` and `discovery_path` to be able to use it.

## Configuring Jupyter { #custom }

1. Get network access from your Jupyter machine to the SPYT cluster, ports `27000-27200`.
2. Get network access from the SPYT cluster to the Jupyter machine, ports `27000-27200`.
3. Install a deb package containing java:
   ```bash
   sudo apt-get update
   sudo apt-get install openjdk-11-jdk

   ```
   Note: starting with version 2.6.0, you can install openjdk-17-jdk instead of openjdk-11-jdk.
4. Install the pip package:

   ```bash
   pip install ytsaurus-spyt

   ```
5. Place your YTsaurus token in `~/.yt/token`:
   ```bash
   mkdir ~/.yt
   cat <<EOT > ~/.yt/token
   $YOUR_YT_TOKEN
   EOT
   ```
6. Place a file called `~/spyt.yaml` with the Spark cluster location in your home directory:

   ```bash
   cat <<EOT > ~/spyt.yaml
   yt_proxy: "cluster_name"
   discovery_path: "$YOUR_DISCOVERY_DIR"
   EOT
   ```

## Updating the client in Jupyter { #new-client }

Update `ytsaurus-spyt` in Jupyter:

```bash
pip install ytsaurus-spyt
```
If the second `ytsaurus-spyt` version component is greater than that in your cluster version, new functionality may not work. Update your cluster per the instructions.
<!-- endsource: en/_includes/user-guide/data-processing/spyt/API/spyt-jupyter.md -->
