You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Visual Studio Code的PowerShell中便捷运行Anaconda命令?

Running Conda Commands Directly in VS Code's PowerShell Terminal

Absolutely, you can replicate that convenience! Running conda commands right in VS Code's PowerShell terminal is totally doable with a quick one-time setup. Here's how to make it work:

Step 1: Initialize Conda for PowerShell

First, fire up Anaconda Prompt as Administrator (right-click the shortcut and pick "Run as administrator"). Then run this command to hook conda into your PowerShell environment:

conda init powershell

This adds a few lines to your PowerShell profile file, which tells PowerShell to load conda's tools every time you open a new terminal session.

Step 2: Test It Out

Close all existing PowerShell windows (including any open in VS Code), then restart VS Code and open a new PowerShell terminal. Now try a simple conda command to confirm it works:

conda --version

If it spits out your conda version, you're all set! You can now use every conda command you know—conda install, conda create, conda activate, etc.—directly in VS Code's PowerShell just like you would in Anaconda Prompt.

Quick Troubleshooting

  • "conda is not recognized" error: Make sure you closed and reopened all terminal/VS Code windows (profile changes only take effect in new sessions). If that doesn't fix it, check your PowerShell execution policy: run Set-ExecutionPolicy RemoteSigned in an elevated PowerShell (say "Y" when prompted) to allow your profile script to run.
  • Don't want base environment auto-activated?: Run conda config --set auto_activate_base false to stop conda from activating the base env every time you open a terminal.

内容的提问来源于stack exchange,提问作者Omar Sharif

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.12 04:11:54