VSCode not coloring certain Python modules

481 Views Asked by At

I have a Python virtual environment (venv) with several external libraries/packages installed, such as torch, gradio, and HuggingFace's transformers. I use the interpreter inside the venv to indicate VSCode of code coloring.

It works well with torch and gradio, but not transformers. It's just whited out (the image below).

VS Code coloring works well with torch and gradio, but not `transformers

Code linting and autocompleting still work well. As shown in the image below, VSCode correctly suggested the function signature and docstring for pipeline.

Code linting and autocompleting still work well

I am using the Dark+ color theme. And my guess is this cannot be fixed by changing the theme as I tried and it didn't help.

Why does it happen? And how to fix it? Thanks a lot!

0

There are 0 best solutions below