5

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

3 Answers 3

11

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.

Sign up to request clarification or add additional context in comments.

1 Comment

in my case, I was using dot-env extension for nodejs. Apparently, extensions that do stuff with the environment will mess the jupyter extension up.
0

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

Disable "Dependency Analytics1

1 Comment

While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
0

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

1 Comment

This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question. - From Review

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.