Visual Studio 代码无法启动 python 到 wsl 终端
Visual Studio Code can't launch python to wsl terminal
我将 VS Code 设置为 运行 bash.exe 作为集成终端。
当我尝试通过右键单击文件并选择 'Run python file in terminal' 在终端中 运行 一个 python 文件时,出现以下错误:
# andy @ Andy-surface in /mnt/c/Users/Karma/ws/sandbox [11:47:46] C:2
$ python c:/Users/Karma/ws/sandbox/flask.py
python: can't open file 'c:/Users/Karma/ws/sandbox/flask.py': [Errno 2] No such file or directory
显然,路径不正确,因为它期望文件位于 /mnt/c/ 而不是 C:/
我如何让 VS Code 将路径从 c:/ 更改为 /mnt/c/?
VS Code 的 Python 扩展当前不支持 WSL。您可以关注 this issue 以了解支持 WSL 的进展(已计划,但我们现在无法提供预计到达时间)。
我将 VS Code 设置为 运行 bash.exe 作为集成终端。
当我尝试通过右键单击文件并选择 'Run python file in terminal' 在终端中 运行 一个 python 文件时,出现以下错误:
# andy @ Andy-surface in /mnt/c/Users/Karma/ws/sandbox [11:47:46] C:2
$ python c:/Users/Karma/ws/sandbox/flask.py
python: can't open file 'c:/Users/Karma/ws/sandbox/flask.py': [Errno 2] No such file or directory
显然,路径不正确,因为它期望文件位于 /mnt/c/ 而不是 C:/
我如何让 VS Code 将路径从 c:/ 更改为 /mnt/c/?
VS Code 的 Python 扩展当前不支持 WSL。您可以关注 this issue 以了解支持 WSL 的进展(已计划,但我们现在无法提供预计到达时间)。