Installing VS Code and Connecting it with Anaconda

Introduction

This tutorial installs Visual Studio Code, installs Anaconda, and connects the two. It assumes you have never written a line of code. Every step has a screenshot. If a step fails, email me () or ask one of the teaching assistants.

Why VS Code?

VS Code is a free code editor made by Microsoft. In the 2025 Stack Overflow Developer Survey, 75.9% of developers reported using it, more than twice the share of any other editor. Three reasons matter for this course.

  • It does what an editor should do, with syntax highlighting, autocompletion, and a debugger built in. Hundreds of extensions cover anything missing.
  • It runs on Windows, macOS, and Linux, so everyone in the class works with the same screen.
  • It works with Git and GitHub out of the box, which you will need for every assignment.

Download and install VS Code

Open https://code.visualstudio.com/. Click “Download” for your operating system.

The VS Code website.

Windows

Run the VSCodeUserSetup-{version}.exe file.

The Windows installer.

Accept the licence agreement. Click “Next”.

The licence agreement.

Keep the default installation location. Click “Next”.

The installation location.

Select “Open with Code” under additional tasks. Click “Next”.

Additional tasks.

Click “Install”.

Installation in progress.

macOS

Open the downloaded .zip file.

Unzip the downloaded file.

Drag the VS Code application to the Applications folder.

Drag VS Code to the Applications folder.

Linux

Follow the instructions for your distribution on the VS Code download page.

Start VS Code

Open VS Code. The welcome screen appears.

The VS Code welcome screen.

Microsoft publishes short introductory videos and full documentation if you want to explore further.

Installing Anaconda

Anaconda is a distribution of Python. It ships with the packages this course uses, and it keeps the Python for one project separate from the Python for another.

Download Anaconda

Open https://www.anaconda.com/download. You can skip the registration.

The Anaconda website.

Click “Download” for your operating system.

Download Anaconda.

Windows

Select “Just Me” as the installation type.

Installation type.

Keep the default installation location.

Installation location.

The installer marks the next two options in red and advises against them. Select them anyway. They make the terminal commands in this course work without extra configuration.

Under “Advanced Options”, tick “Add Anaconda to my PATH environment variable”.

Tick “Register Anaconda as my default Python”.

Advanced options.

macOS

Open the downloaded .pkg file. You can install Anaconda for all users.

The macOS installer.

Accept the default option on each screen.

Installation in progress.

Linux

Follow the instructions for your distribution on the Anaconda website.

Verify the installation

Open a terminal. In VS Code, click “Terminal” > “New Terminal”.

Type conda --version. Press Enter. The Conda version number appears.

Type python --version. Press Enter. The version of Python that Anaconda installed appears.

Both version numbers printed in the VS Code terminal.

If either command reports that it is not found, Anaconda is installed but your terminal cannot see it. Close the terminal and open a new one. If the error persists, reinstall Anaconda and check the PATH option described above.

Connecting VS Code with Anaconda

Both programs are now installed. The next step tells VS Code to run Anaconda’s Python rather than any other Python on your machine.

Install the Python and Jupyter extensions

Click the Extensions icon in the left sidebar. It looks like four squares.

Type “Python” in the search box.

The Python extension in VS Code.

Install the official Python extension by Microsoft.

Install the Jupyter extension as well. Tutorial 02 needs it.

The Jupyter extension in VS Code.

Select the Anaconda interpreter

Click “New File” in the top left corner. Save the file with a .py extension.

A new Python file in VS Code.

Type this code in the file:

import sys
print(sys.version)
print(sys.executable)

Save the file again. I saved mine as testing-anaconda.py.

Saving the Python file.

Press Ctrl+Shift+P (Windows and Linux) or Cmd+Shift+P (macOS). The Command Palette opens.

The Command Palette in VS Code.

Type “Python: Select Interpreter”. Select it from the list.

Selecting the Python interpreter.

Select the Anaconda interpreter. It is labelled something like “Python 3.x.x (‘base’) Conda”.

Verify the connection

Click “Run” in the top right corner of the editor. Select “Run Current File in Dedicated Terminal”.

Running a Python file in VS Code.

The output shows the Anaconda Python version and the path to it. The word anaconda should appear in that path. If it does not, VS Code is running a different Python, and you should select the interpreter again.

The version and path printed in the terminal.

Conclusion

VS Code and Anaconda are installed and connected, and you can run a Python file from the editor. As your projects grow, create a separate Conda environment for each one so their packages cannot conflict.

For more:

Happy coding!

Back to top