EeyoreLee / vscode-extension-yapf

Vscode formatter extension support for python files using `yapf`.
MIT License
18 stars 5 forks source link

There is no formatter for 'python' files installed. #183

Closed 0x1618 closed 4 hours ago

0x1618 commented 5 hours ago

Extension version: v2024.9.126091437. Platform: Windows 11.

Hi, the YAPF extension stopped working for me. I have been using it for more than 2 years, but i encountered errors today. I got the error: 'There is no formatter for Python files installed.'

"[python]": {
    "editor.defaultFormatter": "eeyore.yapf",
    "editor.codeActionsOnSave": {
        "source.organizeImports": "always",
        "source.unusedImports": "explicit"
    }
},
0x1618 commented 4 hours ago

Lol 5 minutes later i have found the fix. In my case, it was a misconfigured python interpreter because vscode couldn't find my venv interpreter. To check errors related to yapf do ctrl + shift + p, type 'Show Logs,' and select YAPF. If you also have a misconfigured Python interpreter, just press Ctrl + Shift + P, type 'Select Interpreter,' and choose the correct interpreter for your project (e.g. from .venv).