Pycln is a fast and efficient code formatter for finding and removing unused import statements in Python code. It helps to keep your codebase clean and reduce unnecessary dependencies. The current version is 2.6.0 and it maintains a relatively frequent release cadence, often aligning with Python version updates and bug fixes.
pip install pyclnVerified import paths — ran on the pinned version, not inferred.
The primary way to use Pycln is through its command-line interface. Run `pycln .` in your project's root directory to scan and remove unused imports. Use `--check` to preview changes, or `--diff` to see a diff.
Upgrade to Python 3.9 or newer, or pin Pycln to `<2.6.0`.
Upgrade to Python 3.8 or newer, or pin Pycln to `<2.5.0`.
Upgrade to Pycln v2.6.0 or newer for full Python 3.14 compatibility.
Upgrade to Pycln v2.5.0 or newer. Ensure your `pyproject.toml` is correctly formatted and accessible.
Upgrade to Pycln v2.1.6 or newer. If issues persist, consider using a `--skip` option for specific files or imports that rely heavily on implicit behavior.