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

# Converting projects to pixi format

export const Comments = ({children}) => {
  return <div class="my-4 px-5 py-4 overflow-hidden rounded-2xl flex gap-3 border border-zinc-500/20 bg-zinc-50/50 dark:border-zinc-500/30 dark:bg-zinc-500/10" data-callout-type="comments">
      <div class="w-4">
        <svg width="14" height="14" viewBox="0 0 640 640" fill="currentColor" xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" aria-label="Comments">
            <path d="M320 112C434.9 112 528 205.1 528 320C528 434.9 434.9 528 320 528C205.1 528 112 434.9 112 320C112 205.1 205.1 112 320 112zM320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576zM280 400C266.7 400 256 410.7 256 424C256 437.3 266.7 448 280 448L360 448C373.3 448 384 437.3 384 424C384 410.7 373.3 400 360 400L352 400L352 312C352 298.7 341.3 288 328 288L280 288C266.7 288 256 298.7 256 312C256 325.3 266.7 336 280 336L304 336L304 400L280 400zM320 256C337.7 256 352 241.7 352 224C352 206.3 337.7 192 320 192C302.3 192 288 206.3 288 224C288 241.7 302.3 256 320 256z" />
        </svg>
      </div>
      <div class="text-sm prose min-w-0 w-full">
        {children}
      </div>
    </div>;
};

## Why convert to pixi?

Pixi is an alternative project format that replaces `anaconda-project.yml` with a `pixi.toml` manifest. It offers dramatically faster environment solves and reproducible lockfiles that ensure environments rebuild identically across sessions and machines.

A single `pixi.toml` file declares all package dependencies (`conda` and `pip`), environments, and tasks. You can also define multiple named environments for different workflows (for example, a default environment and a GPU-enabled variant).

## Converting a project to pixi

New projects are created in the classic `anaconda-project.yml` format. To use the `pixi.toml` format, convert an existing project from within a JupyterLab session.

<Note>
  Converting is non-destructive. Your original `anaconda-project.yml` is preserved alongside the `pixi.toml`.
</Note>

1. Open the project in a JupyterLab session.

   <Note>
     You must be in the JupyterLab Launcher to convert a project. If your project opens directly to a notebook or terminal, open the Launcher first.
   </Note>

2. Click **Convert to pixi**.

   <Frame>
     <img src="https://mintcdn.com/anaconda-29683c67/qxxumlfgqZ1jSTuG/images/workbench-convert-to-pixi.png?fit=max&auto=format&n=qxxumlfgqZ1jSTuG&q=85&s=826760995dcd801ac489acb1e90c9a12" alt="The Convert to pixi button in the project Launcher card" width="1922" height="928" data-path="images/workbench-convert-to-pixi.png" />
   </Frame>

3. The project's environment is renamed to `default` during the conversion process. To retain the original environment name, clear the checkbox in the Convert to pixi modal.

4. Click **Convert**.

   <Frame>
     <img src="https://mintcdn.com/anaconda-29683c67/qxxumlfgqZ1jSTuG/images/workbench-convert-to-pixi-modal.png?fit=max&auto=format&n=qxxumlfgqZ1jSTuG&q=85&s=cd2b573995639d06b07e59ce4c16149e" alt="The Convert to pixi modal and environment name checkbox" width="1922" height="855" data-path="images/workbench-convert-to-pixi-modal.png" />
   </Frame>

   <Note>
     Converted projects use the platform's configured channels (`pkgs/main`) by default. This differs from standalone pixi outside of Workbench, which defaults to `conda-forge`.
   </Note>

## Verifying the pixi environment

To confirm your project is running in the pixi-managed environment, verify that the Python path points under `.pixi/envs/`.

<Tabs>
  <Tab title="Notebook">
    If the project's environment includes `ipykernel`, its kernel becomes available after the build completes.

    1. Open a notebook.
    2. Switch to the pixi environment kernel by clicking the kernel name in the top-right corner of the notebook, then selecting the pixi environment from the list.
    3. Run the following in a cell:

       ```py theme={null}
       import sys
       print(sys.prefix)
       ```

       The output path should be under `.pixi/envs/`.

    If the environment does not include `ipykernel`, JupyterLab falls back to a global kernel. Add `ipykernel` to your `pixi.toml` and re-prepare to get a project-specific kernel.
  </Tab>

  <Tab title="Terminal">
    1. Click the terminal tile for your environment in the Launcher. The environment is activated automatically.
    2. Run the following command:

       ```sh theme={null}
       python -c "import sys; print(sys.prefix)"
       ```

       The output path should be under `.pixi/envs/`.
  </Tab>
</Tabs>

## Updating the pixi environment

After conversion, the environment is automatically prepared. If you later add or remove packages in `pixi.toml`, click the **Prepare environment** action on the Launcher card to rebuild the environment. No session restart is needed.

## Using your pixi environment

Once you are satisfied with your pixi environment, commit and push both `pixi.toml` and `pixi.lock` to the project repository. This ensures that other collaborators and future sessions use the same resolved environment.

<Note>
  Only tagged commits can be deployed or scheduled. After committing your pixi configuration, tag the commit before attempting to deploy or schedule the project.
</Note>

## Running tasks

To run a task defined in `pixi.toml`, use the project's Launcher or run it from a terminal:

```sh theme={null}
pixi run <TASK>
```

<Comments>
  Replace \<TASK> with the name of the task you want to run. <br />

  For example, if your `pixi.toml` defines a task named `train`, you would run: `pixi run train`.
</Comments>

## Reverting to anaconda-project

To revert a project to its original format, delete the `pixi.toml` file. The original `anaconda-project.yml` is preserved during conversion and the project returns to `anaconda-project` mode.
