Installing VS Code on the Raspberry Pi #tt10

Image for Installing VS Code on the Raspberry Pi #tt10
Tinkerer: Lory Livezey

*** IMPORTANT UPDATE AS OF 3/28/2019: There was an update to VS Code for ARM that causes the screen to come up black. After some testing with this, I found that if you open a folder (File -> Open Folder) and wait for about 10 seconds, it will come up as expected. *** There are a lot of good IDE's for developing code, such as Eclipse, PyCharm and Atom, but my preference is Visual Studio Code. I've been using Visual Studio for 20 years, and I do like it, but if Visual Studio were a tank, then VS Code is more like a jeep, that you could convert into a Humvee, or a Chinook . It's flexible, extendible, and relatively new -- it's been on the scene since April of 2016, and Microsoft has really seemed to rethink this product for developing modern front-end applications.

Previous Step

  Configuring Raspberry Pi After Installing Raspbian #tt2

What you will need

Prepare Your Raspberry Pi

First, we'll download and add a GPG security key:

sudo wget -qO - https://packagecloud.io/headmelted/codebuilds/gpgkey | sudo apt-key add -;

The sources file lets apt-get know where to find repositories for libraries:

sudo nano /etc/apt/sources.list

Sources File

Add this line to the file:

deb https://packagecloud.io/headmelted/codebuilds/raspbian/ jessie main

Install VS Code

From the command line, run this to install VS Code:

sudo dpkg --add-architecture armhf && sudo apt-get update && sudo apt-get install code-oss:armhf

Update the Raspberry Pi

sudo apt-get update

Open & Configure VS Code

To open the program:

click the Raspberry > Programming > then Code OSS

Next, open your working directory:

File > Open Folder

I'm going to open a Python file to show you how VS Code will recommend extensions that it thinks you may need.

Sources File

I'm going to go ahead and install the two extensions that will give me handy things like intellisense for Python code.

Success!

Now you can write code on your Pi, and if you followed Configuring Visual Studio Code to Sync with Raspberry Pi (or watch TurboTinker #5 on YouTube), you can write code on your Mac or PC, sync it to the Pi, and develop in both places.

Be sure to subscribe to our channel!