VSCode: путь Python в вашей конфигурации отладки недействителен
Очень новичок в Python и VSCode (и stackoverflow). Я использую оба уже около 3 месяцев, просто отлично, до недавнего времени.
При попытке запустить любую базовую программу Python в отладчике появляется всплывающее окно The Python path in your debug configuration is invalid. Source: Python(Extension) , и отладчик не запускается. Я захожу в свой файл launch.json и, конечно же, у меня есть путь к тому месту, где установлен Python.
Возникновение с settings.json тоже ничего не помогает, потому что у меня есть настроенный путь к Python, но отладчик по-прежнему не запускается. Я не понимаю, что здесь делать. Раньше я никогда не заходил в свои файлы .json, и мне никогда не приходилось настраивать свой путь Python после первой установки VSCode.
2 ответа
Оказалось, что мне пришлось понизить версию моего расширения Python с версии 2021.3 до 2021.2, теперь VSCode, наконец, может найти путь к Python.
Вы можете попробовать что-то подобное, но направив его туда, где ваша программа python установлена в вашей системе
The Python path in your debug configuration is invalid. #12100

- press f5 to debug it
- message fatal:
The text was updated successfully, but these errors were encountered:
dmorris0 commented Jan 3, 2021
I’m getting the same error in VSCode under WSL with Ubuntu 20.04. It used to work fine, but I installed Python 3.7, and now it can’t find my interpreter. I even removed Python 3.7 and am getting this error.
dmorris0 commented Jan 3, 2021
Finally fixed the problem by uninstalling VSCode and reinstalling it. Now it can find the python interpreter.
scalavision commented Jan 6, 2021 •
I also encountered this, running the test from the file works fine, debugging the same test, vscode errors out with The Python path in your debug configuration is invalid , why isn’t those paths the same as a default setting? Not sure I want to reinstall vscode atm. I can’t find a way to set the pythonPath in the config. «pythonPath» shows up as not allowed .
How am I going to configure this?
karthiknadig commented Jan 6, 2021 •
@scalavision Can you share your debug configuration? Normally you don’t have to set the pythonPath in the debug configuration, unless you want to run your code using a different python.

you can also use «python» to set a custom python path (default uses the selected python path):
scalavision commented Jan 6, 2021
I had wrong path to python interpreter in the user settings. When manually setting the path to the interpreter via the gui, to be used inside the dev container, it silently failed. I found it in the Python log output eventually. A popup for this error would have been very helpful
[Solved] VSCode: The Python path in your debug configuration is invalid
Hello Guys, How are you all? Hope You all Are Fine. Today When I run my python code Suddenly I got VSCode: The Python path in your debug configuration is invalid in Python. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
How VSCode: The Python path in your debug configuration is invalid Error Occurs ?
I am trying to debug a simple python program via “F5” or “Run with debugger”. Whenever I press F5 using the python extension, a pop-up appears at the bottom right “The Python path in your debug configuration is invalid.”
How To Solve VSCode: The Python path in your debug configuration is invalid Error ?
- How To Solve VSCode: The Python path in your debug configuration is invalid Error ?
To Solve VSCode: The Python path in your debug configuration is invalid just Open Command Palette (Ctrl + Shift + P). Type Python: Select Interpreter, open it Select the python interpreter or enter the full path to the python interpreter.
Solution 1: add Python:Select Interpreter
Vscode is not able to find the python path or its not yet set.
Open command palette(ctrl+shift+P) and type python and look for “Python:Select Interpreter”. You will be asked to enter the path of python where it is installed.
Incase you are using virtual environment and in most of the case its true. Look for the path .venv/Script/python else select the python path where you have installed in your local machine.
Solution 2: add python path in vscode
- See File — Preferences — Settings .
- Click the “Open Settings (JSON)” button. Make sure that this entry has python.exe at the end. «python.pythonPath»: «C:\\Users\\<your_user_name>\\AppData\\Local\\Programs\\Python\\Python38\\python.exe
Solution 3: add pythonPath
You could try something like this but directing it to wherever your python program is install on your system
Summery
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?