PyCharm 2025.3 Help

Python tools support

Settings | Python | Tools

PyCharm supports several tools to improve code quality, maintainability, and workflow efficiency:

  • Ruff: a high-performance linter and formatter that detects errors and enforces coding standards.

  • Pyright (and basedpyright), Pyrefly, ty: fast type checkers providing real-time type analysis.

  • Black: an automatic code formatter that helps maintain a consistent style.

Ruff

Ruff can highlight issues as you type, suggest fixes, and help maintain consistent code quality across your project. It runs quickly and provides real-time feedback directly in your editor.

Ruff support in PyCharm includes:

  • Formatting

  • Import optimization

  • Quick fixes

  • Configuration file validation

  • Inlay hints for error codes

    View inlay hints for error codes
  • Completions for error codes and configuration options

    Use auto-complete
  • Web links for error codes and configuration options

    Use clickable links to documentation
  • In-editor documentation preview for error codes and configuration options

    Preview documentation in the editor

Configure Ruff

  1. Go to Python | Tools | Ruff in the Settings dialog (Ctrl+Alt+S) .

  2. Ruff settings
  3. Select the Enable checkbox to start configuring Ruff settings.

  4. In the Execution mode setting, select how PyCharm should search for the Ruff executable:

    • Interpreter mode: PyCharm searches for a Ruff executable installed in your interpreter. To install the Ruff package for the selected interpreter, click Install Ruff.

    • Path mode: PyCharm searches for a Ruff executable in $PATH. If the executable is not found, you can specify the path by clicking the Browse... Browse... icon.

  5. Select which Ruff options should be enabled:

    Click All actions on save... to configure additional options. If Ruff integration is enabled in the settings, it will be used when you run Reformat code or Optimize imports.

    Configuring actions on save
  6. Ruff settings can also be configured using a pyproject.toml, ruff.toml, or .ruff.toml file. For more information, refer to the Ruff documentation.

Pyrefly

Pyrefly is a type checker and language server for Python.

Configure Pyrefly

  1. Go to Python | Tools | Pyrefly in the Settings dialog (Ctrl+Alt+S) .

  2. Pyrefly settings
  3. Select the Enable checkbox to start configuring Pyrefly settings.

  4. In the Execution mode setting, select how PyCharm should search for the Pyrefly executable:

    • Interpreter mode: PyCharm searches for a Pyrefly executable installed in your interpreter. To install the Pyrefly package for the selected interpreter, click Install Pyrefly.

    • Path mode: PyCharm searches for a Pyrefly executable in $PATH. If the executable is not found, you can specify the path by clicking the Browse... icon.

  5. Select which Pyrefly options should be enabled:

  6. Pyrefly settings can be configured using a pyrefly.toml or pyproject.toml file. For more information, refer to the Pyrefly documentation.

Pyright and basedpyright

Pyright is a static type checker for Python.

basedpyright is a fork of Pyright with various type checking improvements.

Configure Pyright

  1. Go to Python | Tools | Pyright in the Settings dialog (Ctrl+Alt+S) .

  2. Pyright settings
  3. Select the Enable checkbox to start configuring Pyright settings.

  4. In the Execution mode setting, select how PyCharm should search for the Pyright executable:

    • Interpreter mode: PyCharm searches for a Pyright executable installed in your interpreter. To install the basedpyright package for the selected interpreter, click Install basedpyright.

      If you want to use plain Pyright, install pyright[nodejs].

    • Path mode: PyCharm searches for a Pyright executable in $PATH. If the executable is not found, you can specify the path by clicking the Browse... icon.

  5. Select which Pyright options should be enabled:

  6. Pyright settings can be configured using a pyrightconfig.json or pyproject.toml file. For more information, refer to the Pyright and basedpyright documentation.

ty

ty is a fast Python type checker, written in Rust. It is currently in preview and could be incomplete.

Configure ty

  1. Go to Python | Tools | ty in the Settings dialog (Ctrl+Alt+S) .

  2. ty settings
  3. Select the Enable checkbox to start configuring ty settings.

  4. In the Execution mode setting, select how PyCharm should search for the ty executable:

    • Interpreter mode: PyCharm searches for a ty executable installed in your interpreter. To install the ty package for the selected interpreter, click Install ty.

    • Path mode, PyCharm searches for a ty executable in $PATH. If the executable is not found, you can specify the path by clicking the Browse... icon.

  5. Select which ty options should be enabled:

  6. ty settings can be configured using a pyproject.toml or ty.toml file. For more information, refer to the ty documentation.

Black

You can use Black to format your Python code in PyCharm.

Configure Black

  1. Go to Python | Tools | Black in the Settings dialog (Ctrl+Alt+S) .

  2. In the Execution mode drop-down, select how PyCharm should run the Black formatter:

    • Binary mode: PyCharm uses the Black executable installed in your system. If the executable is not found, you can specify the path by clicking the Browse... icon:

      Configuring Black formatter: binary mode
    • Package mode: PyCharm uses the Black package installed in the project interpreter. To install the Black package for the selected interpreter, click Install Black:

      Configuring Black formatter: package mode
  3. Select when do you want to run the Black formatter:

    • Enable the On code reformat checkbox to use Black instead of the built-in formatter when you press Ctrl+Alt+L or select Code | Reformat Code from the main menu.

    • Select On save if you want to run Black formatter automatically when your changes are saved. To configure additional actions, click All actions on save....

  4. The settings of the Black formatter can be configured in a pyproject.toml file. For Black v21.4.0 and higher, they are applied automatically. For more information, refer to the Black documentation.

    You can also use the Settings field to specify additional options or override the settings from pyproject.toml:

    Specifying Black CLI options

    For more information, refer to the Black CLI reference.

06 November 2025