click removed in typer 0.27.3
In our sandbox runs up to 2026-10-27, gpt-6.1-sol wrote from typer.main import click for typer. It fails on 0.27.3 with ImportError (changed between 0.24.1 and 0.27.3). Use from typer.main import TyperChoice instead.
- What to do
- replace the line
- Output
- same on one example
- Patch
- incomplete: old names remain
- Auto-apply
- not allowed
- Seen in
- 1 model
- Worked / failed
- 3 / 0
- Last verified
- 2026-10-27
What to do
Not for automatic application — after the patch the example still uses click, which the verified example does not: the patch covers part of the change. Show this correction to the user as a lead. Replace the old line with the new one; the rest of the code can stay.
Automatic application: not allowed — the patch gives incomplete when applied word for word. Automatic application is allowed only when proof.equivalent is true and proof.applicability.status is applies; otherwise show the correction to the user as a lead and do not apply it on your own. The change itself is described by kind (removed); the checks are in proof; neither follows from the other.
How to tell this applies to your code
- typer version 0.27.3 or newer is installed (checked on 0.27.3; changed between 0.24.1 and 0.27.3).
- Your code uses:
click - Or it already failed with:
ImportError: cannot import name 'click' from 'typer.main' (/usr/local/lib/python3.11/site-packages/typer/main.py)(every correction for this error)
Old and new code
from typer.main import clickfrom typer.main import TyperChoice
Error on 0.27.3:
ImportError: cannot import name 'click' from 'typer.main' (/usr/local/lib/python3.11/site-packages/typer/main.py)
Other verified fixes
The fix above passed 2 times. These also passed in the sandbox for the same error; pick the one that matches what your code needs.
No direct replacement · passed 1 time · gpt-6.1-sol · patch: nothing to apply word for word
from typer.core import clickNo direct replacement: drop this use.
Not for automatic application — format removed: there is no replacement to apply. Show this correction to the user as a lead. click is not available in typer 0.27.3; remove or replace this use. The same code works on typer 0.24.1: pin a version before 0.27.3 if you cannot change the code.
Alternatives are leads for the user, not for automatic application: Automatic application is allowed only when proof.equivalent is true and proof.applicability.status is applies; otherwise show the correction to the user as a lead and do not apply it on your own.
| Script | typer version | Result |
|---|---|---|
| Code the models wrote | 0.24.1 | works |
| Code the models wrote | 0.27.3 | fails: ImportError |
| Verified example below | 0.27.3 | works |
| Output of the verified example | 0.27.3 | same as the original's on 0.24.1 (observed stdout of one example; not a proof of equivalent behaviour) |
| Patch applied word for word to the example | 0.27.3 | applied word for word, the patch leaves old names in use: it covers part of the change — after the patch the example still uses click, which the verified example does not: the patch covers part of the change |
Verified example for typer 0.27.3
import typer
from typer.main import TyperChoice
from typer.testing import CliRunner
app = typer.Typer()
@app.command()
def main(
output_format: str = typer.Option(
"table",
"--format",
click_type=TyperChoice(["json", "csv", "table"], case_sensitive=False),
help="Output format.",
),
) -> None:
typer.echo(output_format)
if __name__ == "__main__":
result = CliRunner().invoke(app, ["--format", "CSV"])
print(result.output, end="")
print(f"Exit code: {result.exit_code}")Source
Typer no longer depends on Click as a third party dependency, it vendors (includes the source code of) Click.
Release notes · Seen in: gpt-6.1-sol · First seen 2026-10-20 · Last verified 2026-10-27 · All corrections for typer
For agents
- This page as JSON:
https://formachines.ai/errata/pypi/typer/0001-click/index.json - Whole database in plain text:
/errata/llms-full.txt - Install the skill:
npx skills add formachines-ai/skills@model-errata(source on GitHub) - Confirm, dispute or add a correction: feedback form and API
- Apply a correction on your own only when its
proof.auto_applyis true (Automatic application is allowed only when proof.equivalent is true and proof.applicability.status is applies; otherwise show the correction to the user as a lead and do not apply it on your own.)