我正在尝试在Visual Studio Code中运行一个简单的python代码。我的launch.json看起来像这样:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python : Fichier actuel",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}
这是完整的错误:
D:MeDocumentsMEGAIPSAAéro 3Optimisation différentiableTP-Projet>cd "d:MeDocumentsMEGAIPSAAéro 3Optimisation différentiableTP-Projet" && cmd /C "set "PYTHONIOENCODING=UTF-8" && set "PYTHONUNBUFFERED=1" && "C:UsersMy UsernameAppDataLocalProgramsPythonPython37python.exe" """c:/Users/My Username/.vscode/extensions/ms-python.python-2019.5.17517/pythonFiles/ptvsd_launcher.py""" --default --client --host localhost --port 9975 "d:MeDocumentsMEGAIPSAAéro 3Optimisation différentiableTP-Projetprojet.py" "
C:UsersMy UsernameAppDataLocalProgramsPythonPython37python.exe: can't open file '"c:/Users/My Username/.vscode/extensions/ms-python.python-2019.5.17517/pythonFiles/ptvsd_launcher.py"': [Errno 22] Invalid argument
调试器未启动,并显示一条错误消息,告知调试器没有响应。我做错了什么吗?这只是VS代码如何处理文件路径的错误吗?
我的用户名中也有空格,现在您只需要运行,请尝试将 python 扩展回滚回 2019.4.12954 以避免。 它看起来像 2019.5.17059 中的错误。