V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
ReikoMari
V2EX  ›  问与答

vscode Python 插件自动激活环境配置求助

  •  
  •   ReikoMari · 41 天前 · 822 次点击
    这是一个创建于 41 天前的主题,其中的信息可能已经有所发展或是发生改变。

    目前在 vscode 每次启动终端自动激活 conda 环境时 vscode 总是先 PS D:> C:/Users/User/miniconda3/Scripts/activate 弹出一个 cmd 窗口激活 闪一下 有时候弹出来的 wt 还关不掉。然后才激活选择的环境 有什么方法、配置 可以修改吗。 目前是直接把 C:/Users/User/miniconda3/Scripts/activate 给删了 虽然不弹 cmd 窗口了 总是觉得不够优雅。 名称: Python Environments ID: ms-python.vscode-python-envs 版本: 1.1.12031011

    名称: Python ID: ms-python.python 版本: 2025.11.2025072201

    VSCODE 版本: 1.102.2 (user setup)

    1 条回复    2025-07-24 20:07:19 +08:00
    Need4more
        1
    Need4more  
       41 天前
    在 VS Code 设置中添加以下配置:

    {
    "python.condaPath": "C:/Users/User/miniconda3/Scripts/conda.exe",
    "python.defaultInterpreterPath": "C:/Users/User/miniconda3/python.exe",
    "terminal.integrated.profiles.windows": {
    "PowerShell": {
    "source": "PowerShell",
    "args": ["-NoExit", "-ExecutionPolicy", "Bypass"]
    }
    },
    "python.terminal.activateEnvironment": true,
    "python.terminal.activateEnvInCurrentTerminal": false
    }
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1005 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 19:16 · PVG 03:16 · LAX 12:16 · JFK 15:16
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.