PyCharm 2024.3 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 go to Project: <project name> | Python Interpreter. Click the Add Interpreter link next to the list of the available interpreters.

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

  2. Select Add Local Interpreter.

  3. Select uv from the list of environment types.

    Generate new uv environment
  4. Select the base interpreter from the list, or click Choose the base interpreter and find the Python executable in your file system.

  5. Normally, PyCharm will detect uv installation.

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

  6. Click OK to complete the task.

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

Last modified: 24 January 2025