{"id":7849,"library":"vermin","title":"Vermin","description":"Vermin is a static analysis tool that concurrently detects the minimum Python versions required to run code. It is an actively maintained project with frequent updates, often adding support for the latest Python versions (e.g., 3.14, 3.13, 3.12) and expanding its rule set. It functions by parsing Python code into an abstract syntax tree (AST) and matching it against an extensive internal database of Python language features.","status":"active","version":"1.8.0","language":"en","source_language":"en","source_url":"https://github.com/netromdk/vermin","tags":["static analysis","code quality","python version","compatibility","cli-tool"],"install":[{"cmd":"pip install vermin","lang":"bash","label":"Install with pip"}],"dependencies":[],"imports":[{"note":"The API is marked as experimental. Command-line interface is the primary and recommended usage.","symbol":"vermin","correct":"import vermin as V"}],"quickstart":{"code":"# Analyze a Python file or directory\nvermin /path/to/your/project","lang":"bash","description":"Run Vermin from the command line on a specified Python file or directory to determine the minimum required Python versions."},"warnings":[{"fix":"Ensure you are running the 'vermin' command with a Python 3.x interpreter (e.g., `python3 -m vermin` or if `vermin` is in your PATH and points to Python 3).","message":"Vermin v1.6.0 removed support for running Vermin itself using Python 2.x interpreters. While Vermin can still *detect* Python 2.x features in your code, the tool itself must be executed with Python 3+.","severity":"breaking","affected_versions":">=1.6.0"},{"fix":"To enable union type detection, use the `--feature union-types` command-line argument. Be aware of potential incorrect results due to heuristic-based detection.","message":"Detection of Union types (`X | Y` as per PEP 604) became an opt-in feature in v1.5.2 due to potential inaccuracies. It's disabled by default.","severity":"gotcha","affected_versions":">=1.5.2"},{"fix":"Remove the `--lax` argument from your Vermin commands. Adjust your expectations or other configurations to accommodate the stricter default behavior.","message":"The `--lax` mode was entirely removed in Vermin v1.4.0. This option was previously deprecated and is no longer available.","severity":"breaking","affected_versions":">=1.4.0"},{"fix":"If you suspect annotations are affecting results, try using `--eval-annotations`. However, consult the 'Caveats' section of the Vermin documentation, as this can sometimes yield incorrect results. `--no-eval-annotations` is on by default.","message":"When using generic or literal annotations (e.g., `type X = SomeType` or `list[str]`), Vermin might suggest enabling annotation evaluation to get accurate results if annotations are disabled by default (e.g., due to `from __future__ import annotations`).","severity":"gotcha","affected_versions":">=1.4.2"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Ensure `pip`'s binary directory is in your system's PATH, or invoke it directly via `python3 -m vermin <path>`. Always run `vermin` from your system's command line (shell), not inside a Python interpreter.","cause":"The `vermin` executable is not in your system's PATH, or you're trying to run it in a Python REPL instead of a shell.","error":"'vermin' is not recognized as an internal or external command, operable program or batch file."},{"fix":"Exit the Python REPL (e.g., by typing `exit()` or pressing Ctrl+D) and run the `vermin /path/to/file.py` command from your operating system's command line (bash, zsh, cmd, PowerShell, etc.).","cause":"You are attempting to execute a shell command (`vermin`) directly within the Python interactive interpreter (REPL).","error":"SyntaxError: invalid syntax (when trying to run `vermin /path/to/file.py` in Python REPL)"},{"fix":"This is not an error but a diagnostic. Either update your code to be compatible with the `--target` versions, increase your `--target` versions to match the minimums detected by Vermin, or use `--exclude` to ignore specific findings. When using `vermin --violations`, only the problematic lines are shown.","cause":"This is Vermin's intended output when your code contains features requiring a Python version higher than one or more of your specified `--target` versions. The exit code `1` indicates that the target versions were violated.","error":"Minimum required versions: X.Y, Z.W\\nTarget versions not met: A.B, C.D\\n(exit code 1)"}]}