skip to Main Content

I have been using Jupyter Notebook at work on a project, but I have been having difficulties with using it for a while now. When I initially open VSCode, the correct colours for variables and classes in my Python cells shows up, along with autocomplete when I’m typing new lines. However, at some random point this simply stops working, as can be seen in the image below. This happens in all Python cells all at once, without warning. There is no straightforward way to replicate this except for waiting.

How it looks upon opening
After a certain amount of time

I haven’t been able to find anything useful on this anywhere else, but my gut feeling says it might have something to do with some settings conflicts. Also might be relevant but I have problems with VSCode recognising my Python installation. It seems to think that it isn’t installed when it is (C:/Python).

Any help would be greatly appreciated

Restarting the kernel does nothing, changing the cell type does nothing, Dependency Analytics is not installed, Pylance is installed and set as default Python interpreter. The only solution is to close down VSCode fully and reopen it, which is happening on a regular and frustrating frequency. This only happens in Jupyter notebooks, not in regular .py files. This doesn’t actually affect the running of cells, I can still type out code in the ‘after’ state and it will run correctly, however as mentioned without any autocomplete or colours.

2

Answers


  1. The occurrence of this issue could be attributed to conflicting installed extensions within VS Code. When two extensions clash, they may lead to unresponsiveness, often because certain extensions lack an understanding of priority. To troubleshoot, consider disabling extensions one by one to identify the specific extension causing the problem.

    Also, you can find additional details from docs and GitHub. Hope this will help you.

    Login or Signup to reply.
  2. Make sure you have the following settings:

        "editor.semanticHighlighting.enabled": true,
        "python.languageServer": "Pylance",
    

    And also try switching vscode themes (Ctrl+K+T).

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