【问题标题】:Visual Studio Code can't launch python to wsl terminalVisual Studio Code 无法启动 python 到 wsl 终端
【发布时间】:2018-01-27 21:40:32
【问题描述】:

我有 VS Code 设置来运行 bash.exe 作为集成终端。

当我尝试通过右键单击文件并选择“在终端中运行 python 文件”来在终端中运行 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/ ?

【问题讨论】:

    标签: python visual-studio-code windows-subsystem-for-linux


    【解决方案1】:

    VS Code 的 Python 扩展目前不原生支持 WSL。您可以关注 this issue 以跟踪支持 WSL 的进展(计划中,但我们现在无法提供 ETA)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-07-30
      • 1970-01-01
      • 2020-07-30
      • 2020-01-12
      • 2021-05-12
      • 2022-12-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多