Jupyter notebook in VS Code – No color for the python code in ipynb-file. What am i doing wrong?

Question:

Code of .ipynb file:

Code of .ipynb

Python is detected:

The code has color in jupyter notebook:

I tried setting up a jupyter notebook in vs code in an anaconda environment. I have tried – Python: Select interpreter and selected my anaconda environment. Made sure python is in the environment: python –version: Python 3.8.8. Tried clicking on CVE(in the bottom right corner) to change to python (picture 2). The colorization of the code works fine in the interactive window of jupyter notebook (picture 3).

Asked By: C.Bodeval

||

Answers:

Jupyter extension detects your code as CVE instead of Python so Python syntax highlighting is not applied successfully.

Refer to Jupyter in vscode can’t execute syntax highlighting, the Dependency Analytics extension should be the reason. Remove or Disable it then reload window, the question should go away.

Answered By: Molly Wang-MSFT

Disable VS Code’s extension "Dependency Analytics" to solve the missing Syntax Highlighting within Jupyter notebook files.

Disable "Dependency Analytics1

Answered By: Thunder Prime

I had the same issue, and when I reloaded one of my extensions (it was Azure Functions in my case) everything was coloured as normal again. Weird…

Answered By: Erik Horn