V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
ReikoMari
V2EX  ›  问与答

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

  •  
  •   ReikoMari · Jul 24, 2025 · 1248 views
    This topic created in 280 days ago, the information mentioned may be changed or developed.

    目前在 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 replies    2025-07-24 20:07:19 +08:00
    Need4more
        1
    Need4more  
       Jul 24, 2025
    在 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
    }
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2709 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 14:57 · PVG 22:57 · LAX 07:57 · JFK 10:57
    ♥ Do have faith in what you're doing.