skip to Main Content

I just opened Visual Studio Code and this error is displayed at the bottom right of the screen.

The isort server crashed 5 times in the last 3 minutes. The server will not be restarted.

My code can run normally without any problems, but the message keeps popping up every time VSCode is opened.

How to solve this error?

2

Answers


  1. Chosen as BEST ANSWER

    I figured it out that isort is an extension in Visual Studio Code about sorting imports in python, which is not necessary to me. I don't even remember installing it myself.

    Therefore, I just uninstall the extension. As a result, the error goes away (of course).


  2. Here are some other things for you to try – specifying hard paths to your conda (or otherwise) base Python environment’s copy of python and isort, using "useBundled" for the "isort.importStrategy".

    In the setup below we are using black for formatting, flake8 for linting and isort in black compatible mode. isort will inform the user when arguments are out of order. The sorting will happen automatically upon typing and upon save.

    {
        "autoDocstring.docstringFormat": "numpy",
        "autoDocstring.includeName": true,
        ...
        "[python]": {
            "editor.defaultFormatter": "ms-python.black-formatter",
            "editor.formatOnSave": true,
            "editor.codeActionsOnSave": {
                "source.organizeImports": true
            },
        },
        "python.linting.pylintEnabled": false,
        "python.linting.flake8Enabled": true,
        "editor.formatOnSave": true,
        "python.languageServer": "Pylance",
        "editor.formatOnType": true,
        "python.formatting.provider": "black",
        ...
        "isort.importStrategy": "useBundled",
        "isort.logLevel": "error",
        "isort.args": [
            "--profile",
            "black"
        ],
        "isort.check": true,
        "isort.interpreter": [
            "/Users/rjurney/opt/anaconda3/bin/python"
        ],
        "isort.path": [
            "/Users/rjurney/opt/anaconda3/bin/isort"
        ],
    

    It is really worth it to get this working – your code becomes pretty right before your eyes and everyone is on the same format settings in your project if you create workspace settings 🙂

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search