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

Mac系统更新Anaconda后,如何配置使用Visual Studio Code?

Connecting VS Code to Updated Anaconda (1.6.9) on Mac

Hey there, let's get your VS Code linked up with your updated Anaconda installation smoothly. Here's what you need to do:

Step 1: Confirm Your Conda Path

First, let's make sure we know exactly where Anaconda's conda tool lives. Open your Mac terminal and run:

which conda

You'll get a path like /Users/[your-username]/anaconda3/bin/conda—jot this down, we'll need it in a later step.

Step 2: Install the Python Extension in VS Code

VS Code relies on its official Python extension to integrate with Anaconda environments. Here's how to get it:

  • Open VS Code, click the Extensions icon (the square icon on the left sidebar)
  • Search for Python (published by Microsoft)
  • Click "Install" to add it to your VS Code setup.

This is the core step to connect the two tools:

  1. Press Cmd + Shift + P to open the Command Palette in VS Code
  2. Type Python: Select Interpreter and hit Enter
  3. In the dropdown list, look for an option labeled base (anaconda3)—select that if it appears.
  4. If you don't see it, choose Enter interpreter path, then paste the path from Step 1 but replace conda with python (e.g., /Users/[your-username]/anaconda3/bin/python) and confirm.

Step 4: Verify the Connection

Let's confirm everything is working as expected:

  • Create a new Python file (e.g., test_connection.py) in VS Code
  • Paste this code snippet:
import sys
import conda
print("Python executable path:", sys.executable)
print("Conda version:", conda.__version__)
  • Run the file (click the play button in the top right, or use Cmd + F5)
  • Check the terminal output: it should show your Anaconda Python path and conda version 1.6.9, which means the integration is successful.

Bonus: Work with Custom Conda Environments

If you want to use a specific conda environment instead of the default base one:

  1. In your terminal, create the environment first:
conda create -n my_custom_env python=3.9
  1. Activate it once to register it properly:
conda activate my_custom_env
  1. Go back to VS Code's Command Palette, run Python: Select Interpreter again—you should now see my_custom_env in the dropdown list. Select it, and you're ready to work in that environment.

If VS Code doesn't pick up the environment right away, try restarting the app or double-checking that your Anaconda path is correct.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.27 03:28:00