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.

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
Before you start
Section titled “Before you start”-
A language server. Ferris IDEA tries these in order and uses the first it finds:
Server Install basedpyright pip install basedpyrightpyright npm install -g pyrightpylsp pip install python-lsp-server -
debugpy for debugging, in the
python3that is first on yourPATH(the debug adapter is started with it): -
Optionally ruff or black for formatting, and pytest for the test tree, in the project’s environment.
Choose the interpreter
Section titled “Choose the interpreter”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.
- Open the project. The status bar shows the interpreter, for example “Python 3.9 (.venv)”.
- Click it. The list shows every interpreter found, then Automatic choice and New virtual environment in .venv.
- Pick one. The choice is stored in
.ferris-idea/python.tomlin 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.
Install packages
Section titled “Install packages”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 … |
Run a file
Section titled “Run a file”- Open a file with
if __name__ == "__main__":. The gutter shows ▶ on that line. - 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).
Run tests with pytest
Section titled “Run tests with pytest”- Declare pytest in
pyproject.toml(or install it). The run list then shows pytest under “Detected from build files”. - In
test_*.pyand*_test.pyfiles the gutter shows ▶ on everytest…function andTest…class; Run Current File with the caret in one runs just that test asfile::Class::name. - The result tree shows each test with its time; see Run tests.
Plain unittest runs are not read into the tree.
- Set a breakpoint (⌘F8).
- Run › Debug Current File (⌃⇧D). The program runs with the selected interpreter under debugpy and stops at the breakpoint.
- 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.
Format and organize imports
Section titled “Format and organize imports”- Reformat Code (⌥⌘L) uses the first of: ruff in the selected
environment, ruff on the
PATH, black in the environment, black on thePATH. 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-onlywhen ruff is there. Without ruff it removes the imports the server marks unused and sorts nothing.
Refactor
Section titled “Refactor”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.
Limits
Section titled “Limits”- 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
python3from thePATH, not with the selected interpreter.
When it does not work
Section titled “When it does not work”- “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
python3on yourPATH, 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.
Shortcuts
Section titled “Shortcuts”| Action | Shortcut |
|---|---|
| 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 |
For agents
Section titled “For agents”format_fileFormat a workspace file (or arange) as Reformat Code does.optimize_importsOptimize Imports.python_create_venvCreate 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_environmentsPython 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 satisfiesrequires-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_packagesInstall 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;installerandnotessay which and why.python_language_serverThe 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'sworkspace/configuration(python.pythonPath), and whetherpyrightconfig.jsonor[tool.pyright]names an environment (then that file decides).python_package_infoDetails 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 forversionor the latest (uv, Poetry or pip as the project and environment dictate;notesexplains substitutions).python_search_packagesSearch 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_interpreterChoose 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.
No tool matches. Try fewer words, or .
