Loading

真正能用的,解决vscode python 终端不自动进入虚拟环境

#.vscode/settings.json
# powershell 终端配置内容
{
    "terminal.integrated.profiles.windows": {
        "PowerShell": {
            "source": "PowerShell",
            "icon": "terminal-powershell",
            "args": ["-NoExit", "-Command", ". '${workspaceFolder}\\..\\venv\\Scripts\\Activate.ps1'"]
        }
    },
    "terminal.integrated.defaultProfile.windows": "PowerShell"
}

修改vscode 的 settings.json文件。

 更新20240812
手动添加红色部分代码,记得最上面一行的逗号,json的分割符。

{
    "MicroPython.executeButton": [
        {
            "text": "▶",
            "tooltip": "运行",
            "alignment": "left",
            "command": "extension.executeFile",
            "priority": 3.5
        }
    ],
    "MicroPython.syncButton": [
        {
            "text": "$(sync)",
            "tooltip": "同步",
            "alignment": "left",
            "command": "extension.execute",
            "priority": 4
        }
    ],
    "terminal.integrated.profiles.windows": {
        "PowerShell": {
            "source": "PowerShell",
            "icon": "terminal-powershell",
            "args": ["-NoExit", "-Command", ". '${workspaceFolder}\\.venv\\Scripts\\Activate.ps1'"]
        }
    },
    "terminal.integrated.defaultProfile.windows": "PowerShell"
}

  

posted @ 2024-03-03 07:42  上官飞鸿  阅读(2787)  评论(0)    收藏  举报