Search code examples
pythonvisual-studio-codejupyter-notebookcolor-scheme

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


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).


Solution

  • 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.