# Setting Up Visual Studio Code¶

Note: This is written assuming you’ve already installed and setup Python using miniconda as instructed here. If you haven’t, please go do that now!

As noted in our previous reading, here in Duke MIDS we’re converging on using VS Code in our courses as our “preferred” tool for editing and running code. That’s not because we necessarily because we think it’s “the objectively best editor”—what editor is best for an individual depends a lot on their own background, programming style, and work flow!— but rather because we think it’s a good fit for most students. Moreover, by all supporting the same editor, we can help you get really good with VS Code—not everyone will agree VS Code is the best editor, but I think all data scientists will agree that getting really good with an editor is an important skill!

So to see why we’re using VS Code, please start out by watching this video. It provides the reasons we chose VS Code, and what we think is exciting about it.

## Installing VS Code¶

VS Code is kinda stupid-easy to install — just download it here!

Then, if you’re on a Mac, we want to do one more important thing: set up your system so that if you type code [filename] on the command line, VS Code will open [filename] (this gets set up automatically with Windows, but requires a deliberate step on Macs):

• In VS Code, type Command-Shift-P. This will cause the Command Pallet to open at the top of your open window.

• Type Shell Command: Install code command in PATH and open that.

• Wait for confirmation.

### Set terminal.integrated.inheritEnv to False in VS Code¶

In order to ensure that the integrated terminal in VS Code works properly with Miniconda, we have to modify one setting. To do this, in VS Code, go down to the bottom-left corner and click on the gear icon, select “Command Pallet…,” and type “Preferences: Open Settings (JSON)” (note the (JSON) at the end). That should bring you to a relatively blank document. Between the curly braces, add the following:

"terminal.integrated.inheritEnv": false,


So that your file looks something like:

(Note the commas at the end of each line). If you forget the step VS Code will try to prompt you to set it later with this notification:

So if you see that notification make sure to select yes.

## Follow Along With This Video¶

Here’s a video I made exploring how to set up VS Code for Python Data Science. This starts with installing miniconda and doing the install steps above, so start 11 minutes in! The link above should start about there.