Vscode python debugging and running environment settings

Vscode python debugging and running environment settings


foreword

1. Do you have to worry about choosing an environment every time you run a python program?

Create a new settings.json under the .vscode folder (if you don’t have one), write the environment you want to use in it

{
    
    
    "python.pythonPath": "C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python38\\python.exe",
}

2. Are you troubled by the inability to enter standard/third-party libraries for python program debugging?

Add a sentence to launch.json under the .vscode folder:

"justMyCode": false

If there is no such file, it can be written (the current file can be left blank)

{
    
    
    "version": "0.2.0",
    "configurations": [
        {
    
    
            "name": "Python: 当前文件",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": false
            
        }
    ]
}

Guess you like

Origin blog.csdn.net/qq_37249793/article/details/132160751