> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alkera.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment and kernel

> The Python environment your notebooks use, the kernel that runs them, and the compute underneath.

A notebook's code runs in a **kernel** on the workspace's [machine](/workspaces/machines), using the workspace's Python **environment**.

## The default environment

Each workspace has a default environment that every notebook in it uses. It comes with:

| Area | Packages |
| - | - |
| Data | polars, pandas, pyarrow, duckdb, numpy |
| Charts | matplotlib, seaborn, plotly, altair |
| Widgets | ipywidgets, anywidget |
| Science | scipy, scikit-learn, statsmodels |
| I/O | requests, httpx, sqlalchemy, openpyxl |
| Utilities | pydantic, tqdm, beautifulsoup4 |

## Add packages

Open **Panels** in the toolbar and choose **Environment**.

<Steps>
  <Step title="Add the package">
    Type package names in the box, such as `lightgbm` or `scikit-learn==1.5`, and click **Install**.
  </Step>

  <Step title="Build">
    The package is added under **Requirements**. Alkera builds the environment and lists everything under **Installed**.
  </Step>
</Steps>

Click **Remove** next to a requirement to drop it. You can also ask the agent to install a package. It asks first, depending on your [permission mode](/foundations/agent-and-tools#permission-modes).

Packages are installed into the workspace's environment, so every notebook in the workspace gets them.

### Packages after sleep

The environment's package list, and a lock file that pins exact versions, are saved in the workspace's folder. The installed packages themselves are not. After the workspace [sleeps](/workspaces/overview#sleep-and-wake) or moves to another machine, Alkera rebuilds the environment from that list, so the first run can take longer.

Packages installed any other way, such as with `pip install` in a shell, are not on the list and are gone after sleep. Add them in the **Environment** panel so they stay.

## The kernel

A kernel starts the first time you run a cell. Opening a notebook does not start one. Everyone in the notebook shares its kernel.

* **Interrupt** stops the running cell. If it does not stop, Alkera escalates to a restart.
* **Restart** clears every variable in memory. Saved outputs stay on screen, marked **Not run in this kernel**.
* The toolbar shows memory use and warns at 80%. If the kernel runs out of memory, it is restarted.

When the workspace [sleeps](/workspaces/overview#sleep-and-wake), the kernel stops. Variables are not kept, so re-run the notebook when you return. If the workspace is asleep when you run a cell, the notebook shows **Waking the workspace…** first.

## Compute

Notebooks run on the machine their workspace runs on. For large data, long-running jobs, or training models, move the workspace to a dedicated CPU or GPU [machine](/workspaces/machines#move-a-workspace-to-another-machine).

Files and the environment's package list move with the workspace, and the environment is rebuilt on the new machine.

## Notebook settings

Open **Settings** (the gear in the toolbar) to change:

* **When a cell runs**: autorun or lazy. See [Reactivity](/notebooks/reactivity#run-modes).
* **Frames as**: Polars or pandas for SQL results.
* **Rows per SQL result**: a cap on rows returned by SQL cells.

## Related

<Columns cols={2}>
  <Card title="Machines" icon="server" href="/workspaces/machines">
    Standard compute and dedicated CPU and GPU machines.
  </Card>

  <Card title="Keyboard shortcuts" icon="keyboard" href="/notebooks/shortcuts">
    Run, interrupt, and restart from the keyboard.
  </Card>
</Columns>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.