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

# Upgrade Python to 3.14 in a compute environment

> Upgrade Python to 3.14 and install JupyterLab in a Domino compute environment by adding Dockerfile Instructions that use either uv (pip) or conda.

The Python version in a compute environment is fixed by its base image. To run a newer version, such as Python 3.14, add Dockerfile instructions to the environment that install it and JupyterLab. Use the uv (pip) instructions or the conda instructions.

## Applies to

All deployment types and Domino versions. The installation steps were tested with the Domino Standard Environment (DSE) 6.2.3.

<Note>
  If your environment uses a base image other than DSE 6.2.3, you may need to modify the instructions. Details such as the installed tools (`pip`, `conda`), the `ubuntu` user, and the paths in the examples can differ between images.
</Note>

## Choose uv (pip) or conda

Use the option that matches how your environment already installs packages. The following points can also decide between them:

* **Licensing:** Anaconda's terms of service apply to packages from its `defaults` channels, and organizations with 200 or more employees need a paid license to use them. Packages from the community `conda-forge` channel are free. Check which channels your conda installation uses, or use the uv (pip) option, which installs from PyPI.- **Access:** The build must be able to reach the package source. PyPI and the Anaconda repositories are separate hosts, and your network or internal mirror might allow only one of them. The uv option also downloads the Python 3.14 interpreter itself, so confirm that download is allowed.
* **Rate limits:** Anaconda returns an HTTP 429 error when usage of its package repositories exceeds its rate limits, which can fail builds that run often or in parallel. PyPI recommends that heavy users run their own mirror or cache.
* **Compatibility:** The conda option upgrades Python inside the existing conda installation, which can change the versions of other conda packages in the environment. The uv option creates a separate virtual environment at `/opt/venv` and leaves the existing installation untouched.

## Upgrade Python

Both options have been tested with JupyterLab workspaces on DSE 6.2.3.

<Steps>
  <Step title="Open the environment">
    Open the compute environment and go to its **Dockerfile Instructions**.
  </Step>

  <Step title="Add the instructions">
    Add the instructions for the tool you use.

    <Tabs>
      <Tab title="uv (pip)">
        Setting `UV_PYTHON_INSTALL_DIR` makes every uv command use the same install location. Setting `UV_PYTHON_DOWNLOADS=never` makes a mismatch fail at build time instead of at workspace start. The `uv python install` command sets `UV_PYTHON_DOWNLOADS=automatic` for that one command, because it is the only step that needs to download Python.

        ```dockerfile theme={null}
        USER root

        ENV UV_PYTHON_INSTALL_DIR=/opt/python
        ENV UV_PYTHON_DOWNLOADS=never

        RUN pip install --no-cache-dir uv \
         && UV_PYTHON_DOWNLOADS=automatic uv python install 3.14 \
         && uv venv /opt/venv --python 3.14 --seed \
         && uv pip install --python /opt/venv/bin/python \
              jupyterlab jupyter-client jupyter-core jupyter-server \
              jupyterlab-widgets jupyterlab-git certifi \
         && chmod -R a+rX /opt/python /opt/venv \
         && chown -R ubuntu:ubuntu /opt/venv /opt/python

        ENV VIRTUAL_ENV=/opt/venv
        ENV PATH=/opt/venv/bin:$PATH

        USER ubuntu
        ```

        <Note>
          Keep the `UV_PYTHON_INSTALL_DIR` setting. Without it, uv can download a second copy of Python 3.14 into `/root/.local/share/uv/python` and link the venv to it. The `ubuntu` user that runs the workspace can't access `/root`, so the workspace fails to start with a `Permission denied` error on `/opt/venv/bin/python`.
        </Note>
      </Tab>

      <Tab title="conda">
        This option upgrades Python inside the existing conda installation, so you need no separate virtual environment or `PATH` change.

        ```dockerfile theme={null}
        USER root

        RUN conda install -c conda-forge --force-reinstall certifi
        RUN conda install -y python=3.14 && conda install -c conda-forge jupyterlab
        RUN pip install jupyterlab jupyter-client jupyter-core jupyter-server jupyterlab-widgets jupyterlab-git

        USER ubuntu
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Build a new revision">
    Build a new revision of the environment.
  </Step>

  <Step title="Start a new workspace">
    Start a new workspace from the new revision. Open a terminal and run the following command to confirm the Python version:

    ```bash theme={null}
    python --version
    ```

    The output shows Python 3.14.
  </Step>
</Steps>

If you used the uv option and the workspace fails to start with `Permission denied`, run the following command in the built image. The path must not resolve under `/root/`:

```bash theme={null}
readlink -f /opt/venv/bin/python
```

If the path is correct, run `namei -l /opt/venv/bin/python` and look for a directory in the path that the `ubuntu` user can't traverse. Also confirm that the workspace runs as the same user ID (UID) as the `ubuntu` user in the image.

## Related

* Preload Environment packages, including Dockerfile best practices, in the Domino documentation: [6.3](/knowledge-base/6.3/platform-capabilities/core-concepts/compute-environments/add-packages-to-environments/preload-environment-packages) and [Domino Cloud](/knowledge-base/cloud/platform-capabilities/core-concepts/compute-environments/add-packages-to-environments/preload-environment-packages)
* [Installing packages and dependencies](/knowledge-base/installing-packages-and-dependencies)


## Related topics

- [How-to guides](/knowledge-base/how-to-guides-overview.md)
- [Upgrades & maintenance](/cloud/admin/operations/upgrades-maintenance.md)
- [The python-domino library](/cloud/reference/python-sdk/python-domino.md)
- [Unable to deploy Model - [Errno 13] Permission denied: '/.cache'](/knowledge-base/unable-to-deploy-model-errno-13-permission-denied-cache.md)
