Search code examples
pythonvisual-studio-codeisort

How to find which isort is vscode exactly using


https://code.visualstudio.com/docs/python/editing#_sort-imports

I have set

    "[python]": {
        "editor.codeActionsOnSave": {
            "source.organizeImports": true
        }
    },

in vscode, it looks the right python interpreter is chosen, but it doesn't produce sorted imports as expected. I suspect a wrong isort is being used by vscode, how could I find out which isort is vscode exactly using?


Solution

  • VS Code ships with its own copy of isort that it uses which is currently isort 5.10.1. You can look in the Output panel in the Python channel to see how the extension is executing isort.

    But do note that the Python extension is moving away from embedded isort support and instead to a dedicated isort extension.