PyCharm 2025.1 Help

Configure a uv environment

The uv tool makes Python development easier, reducing setup tasks for new projects and helping manage existing ones.

To use uv in PyCharm, you need to install it on your machine and create a specific Python environment.

When you select uv while creating a new Python project, PyCharm automatically generates a pyproject.toml file. This file specifies required packages, scripts, plugins, and URLs. See the pyproject guide to learn more about its structure and format.

Create a uv environment

  1. Do one of the following:

    • Click the Python Interpreter selector and choose Add New Interpreter.

    • Press Ctrl+Alt+S to open Settings and navigate to Project: <project name> | Python Interpreter.

    • Click the Python Interpreter selector and choose Interpreter Settings. Click the Add Interpreter link next to the list of the available interpreters.

  2. Click the Add Interpreter link next to the list of available interpreters and select Add Local Interpreter.

  3. The following actions depend on whether you want to generate a new virtual environment or to use an existing one.

    New uv environment
    Generate new uv environment
    1. Select uv from the list of environment types.

    2. Select the base interpreter from the list, or click Choose the base interpreter and find the Python executable in your file system.

    3. Normally, PyCharm will detect uv installation.

      Otherwise, specify the location of the uv executable, or click uv executable location to browse for it.

    Existing uv environment
    Select existing uv environment
    1. Select uv from the list of environment types.

    2. Normally, PyCharm will detect uv installation.

      Otherwise, specify the location of the uv executable, or click Conda executable location to browse for it.

    3. Select the environment from the list.

    The selected uv environment will be reused for the current project.

  4. Click OK to complete the task.

For any of the configured Python interpreters (but Docker-based), you can:

Last modified: 27 February 2025