skip to Main Content

Hi I found that the Python extension is not properly activated in the VS Code.

The variable names are not properly recognized (highlighted) as shown below

enter image description here

In addition, it does not prompt out the variable name for auto-completion.

enter image description here

But I think I have checked the auto-completion.

enter image description here

I tried version v2023.16.0 and v2024.2.1. Both do not work for me.
Python version: Python 3.8.18
OS version: Ubuntu 20.04.6 LTS (Focal Fossa)

Thanks a lot!!!

2

Answers


  1. Chosen as BEST ANSWER

    Finally resolved this by pyrightconfig.json file in the workspace.

    {
        "include": [
            "codes"
        ]
    }


  2. This was possible caused by not choosing python environment.

    You can use shortcuts "Ctrl+Shift+P" and type "Python: Select Interpreter" to choose your python interpreter.

    You could read document about python for more details.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search