Reputation: 53
Code of .ipynb file:
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).
Upvotes: 5
Views: 8755
Reputation: 1
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...
Upvotes: 0
Reputation: 1
Disable VS Code's extension "Dependency Analytics" to solve the missing Syntax Highlighting within Jupyter notebook files.
Disable "Dependency Analytics1
Upvotes: 0
Reputation: 9471
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.
Upvotes: 11