skip to Main Content

I am trying to work with virtual environments and it works fine but im getting squiggly lines everywhere even when the code runs perfectly.

I’ve tried to create a launch.json file by going into Run and Debug > create a launch.json file and this is what my launch.json looks right now.

"version": "0.2.0",
    "configurations": [

        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "python":"${config.python.pythonPath}",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": true,
            "env": {
                "PYTHONPATH": "C:/Users/DC/AppData/Local/Programs/Python/Python39/python.exe;C:/Users/DC/FlaskTut/Environments/flask_project_env/Scripts/python.exe"
            }
        }

    ]

I’ve tried replacing the semicolon with a colon and a comma, replaced the backslash with double forward slashes and even changed the order of paths but nothing is working.
Another important detail might be that I’m getting a yellow squiggly under "${config.python.pythonPath}"

Also, I had "pythonPath": "${config.python.pythonPath}" intially but VS code automatically changes that to "python":"${config.python.pythonPath}"

2

Answers


  1. "version": "0.2.0",
    "configurations": [

        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": true,
            "env": {
                "PYTHONPATH": "C:/Users/DC/AppData/Local/Programs/Python/Python39/python.exe;C:/Users/DC/FlaskTut/Environments/flask_project_env/Scripts/python.exe"
            }
        }
    
    ]
    

    Remove "python":"${config.python.pythonPath}" as its not needed.

    Login or Signup to reply.
  2. launch.json is just a debugging configuration file.
    You can add intellisense paths using the following settings in settings.json.

      "python.analysis.extraPaths": [
        "PATH/HERE"
      ],
      "python.autoComplete.extraPaths": [
        "PATH/HERE"
      ],
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search