Skip to content

Python

Open a folder with Python files and Ferris IDEA picks an interpreter, starts a type-checking language server against it, runs your files and pytest tests with it, and debugs them with debugpy. Python support is Works; its limits are listed under Limits.

Run pytest tests from the editor
Editor with tests/test_tides.py: two test functions, test_average_of_two and test_average_of_one, each with a green run arrow in the gutter; the status bar shows Python 3.9 (.venv)
  1. Editor with tests/test_tides.py: two test functions, test_average_of_two and test_average_of_one, each with a green run arrow in the gutter; the status bar shows Python 3.9 (.venv)
  2. The Run tool window below shows the result tree Test Results › test_tides with both tests passed and their times, and beside it pytest's output ending with 2 passed and Process finished with exit code 0; the summary reads Tests passed: 2 of 2 tests

Real frames of the application · ferris-idea drive, then ferris-idea drive screenshot after each step (docs/site/scripts/record-tour.py) · main build of v1.6.0, 2026-12-04 · throwaway Python demo project with pytest in a virtual environment; theme Ferris IDEA Dark

  • A language server. Ferris IDEA tries these in order and uses the first it finds:

    Server Install
    basedpyright pip install basedpyright
    pyright npm install -g pyright
    pylsp pip install python-lsp-server
    Terminal window
    npm install -g pyright

    One of the three; the install commands Ferris IDEA names in language_servers, version 1.6.0.

  • debugpy for debugging, in the python3 that is first on your PATH (the debug adapter is started with it):

    Terminal window
    python3 -m pip install debugpy
  • Optionally ruff or black for formatting, and pytest for the test tree, in the project’s environment.

Ferris IDEA finds interpreters without starting them: a choice you stored, the active VIRTUAL_ENV, environments inside the project (.venv first, then venv, any folder with a pyvenv.cfg), CONDA_PREFIX, pyenv versions, and python3 or python on the PATH. Without a stored choice it takes the first that applies in this order: VIRTUAL_ENV, the project’s environment, .python-version, conda, the PATH, the newest pyenv version.

  1. Open the project. The status bar shows the interpreter, for example “Python 3.9 (.venv)”.
  2. Click it. The list shows every interpreter found, then Automatic choice and New virtual environment in .venv.
  3. Pick one. The choice is stored in .ferris-idea/python.toml in the project, and the running language server is told the new interpreter without a restart.

The same commands are in Tools › Python › Select Interpreter… and Tools › Python › New Virtual Environment. A new environment is made with <interpreter> -m venv .venv.

Environments that Poetry or Pipenv keep outside the project are not found. Create the environment in the project (poetry config virtualenvs.in-project true) or activate it before you start Ferris IDEA, so that VIRTUAL_ENV names it.

If pyrightconfig.json or [tool.pyright] in pyproject.toml names a venv, that setting decides what pyright analyzes.

View › Tool Windows › Python Packages lists the packages of the selected environment, searches PyPI and installs. The installer follows the project:

The project has Ferris IDEA runs
uv.lock or [tool.uv] uv pip install --python <interpreter> …
poetry.lock or [tool.poetry] poetry add name==version when you add from the index
an environment made by uv venv, or one without pip uv
anything else <interpreter> -m pip install …
  1. Open a file with if __name__ == "__main__":. The gutter shows ▶ on that line.
  2. Run › Run Current File (⌃⇧R) runs it with the selected interpreter; the output appears in the Run tool window.

For arguments, environment variables or another working folder, add a Python file configuration in Run › Edit Configurations… (Run configurations).

  1. Declare pytest in pyproject.toml (or install it). The run list then shows pytest under “Detected from build files”.
  2. In test_*.py and *_test.py files the gutter shows ▶ on every test… function and Test… class; Run Current File with the caret in one runs just that test as file::Class::name.
  3. The result tree shows each test with its time; see Run tests.

Plain unittest runs are not read into the tree.

  1. Set a breakpoint (⌘F8).
  2. Run › Debug Current File (⌃⇧D). The program runs with the selected interpreter under debugpy and stops at the breakpoint.
  3. Step, look at variables and evaluate as described in Debug a program. Show Referring Objects… in the Variables menu works for Python only.

To debug a process that is already running, or one started with debugpy --listen, use Attach to Process.

  • Reformat Code (⌥⌘L) uses the first of: ruff in the selected environment, ruff on the PATH, black in the environment, black on the PATH. Ferris IDEA installs neither. In a project you have not trusted, the environment’s tools do not run.
  • Code › Optimize Imports (⌃⌥O) runs ruff check --select F401,I --fix-only when ruff is there. Without ruff it removes the imports the server marks unused and sorts nothing.

pyright offers no extract or inline, so Ferris IDEA does these itself: Extract Variable (⌥⌘V), Extract Constant, Extract Method (⌥⌘M) and Inline Variable (⌥⌘N). Rename comes from the server.

  • No inline of functions, methods or parameters, and no Extract Field or Extract Parameter.
  • Optimize Imports without ruff does not sort.
  • Interpreters outside the project made by Poetry or Pipenv are not found.
  • The ruff linter is not run; Ferris IDEA’s own Python inspections (unused import and variable, bare except, shadowed names, unresolved names, method could be static) and the server’s diagnostics are.
  • The debug adapter runs with python3 from the PATH, not with the selected interpreter.
  • “No Python language server: … not found”: install one of the three servers.
  • “Cannot debug Python: debugpy is not installed (pip install debugpy)”: install debugpy into the python3 on your PATH, not only into the project’s environment.
  • Imports are marked unresolved: the selected interpreter is not the one with the packages; click the interpreter in the status bar and choose the project’s environment.
Keyboard of
ActionShortcut
Code › Optimize Imports⌃⌥OCtrlAltO
Code › Reformat Code⌥⌘LCtrlAltL
Refactor › Extract/Introduce › Extract Method⌥⌘MCtrlAltM
Refactor › Extract/Introduce › Extract Variable⌥⌘VCtrlAltV
Refactor › Inline⌥⌘NCtrlAltN
Run › Debug Current File⌃⇧Dno shortcut
Run › Run Current File⌃⇧RCtrlShiftF10

  • format_filechangesdry run by defaultwritetrusted-projectFormat a workspace file (or a range) as Reformat Code does.
  • optimize_importschangesdry run by defaultwritetrusted-projectOptimize Imports.
  • python_create_venvchangesdry run by defaultrunwriteCreate a Python virtual environment in the workspace (<base> -m venv <path>, path default .venv) from the selected interpreter or its base, and choose it.
  • python_environmentsreadsPython interpreters for the workspace without starting any of them: virtual environments in the project, the active VIRTUAL_ENV/CONDA_PREFIX environment, pyenv versions and interpreters on PATH, with version and kind; which one is selected and why; whether it satisfies requires-python; installed packages of the selected environment; declared dependencies that are missing or have a non-matching version; test framework and a suggested test run configuration.
  • python_install_packageschangesdry run by defaultruntrusted-projectInstall Python packages into the selected virtual environment (no shell), using uv when the project or environment uses it and uv is on PATH, else pip; installer and notes say which and why.
  • python_language_serverchangesdry run by defaultwriteThe Python language server (pyright or basedpyright) of the workspace and the interpreter it resolves imports with: server program and path (or why there is none), the selected interpreter and why, the settings answered to the server's workspace/configuration (python.pythonPath), and whether pyrightconfig.json or [tool.pyright] names an environment (then that file decides).
  • python_package_infochangesrunhttpDetails of one PyPI package: summary, latest version, requires-python, home page, versions newest first (pre-releases marked), the version installed in the selected environment, and the exact install command for version or the latest (uv, Poetry or pip as the project and environment dictate; notes explains substitutions).
  • python_search_packageschangeshttpSearch the Python package index (PyPI) by package name: exact name first, then names starting with the query, then names containing it (normalised, at most 50), each with the version installed in the selected environment.
  • python_select_interpreterchangesdry run by defaultwriteChoose the workspace's Python interpreter as the status bar chooser does: saved in .ferris-idea/python.toml (workspace-relative inside the workspace) and used by python_environments, the Python Packages window and new installs.