Install Development Tools on Your Cloud PC

This is step 3 of 6 of Hands-On Project 2 for both Azure and AWS. In this step, you install the development tools which we will be using for the remainder of the project, including MySQL and Visual Studio Code.

Back to Project

Install MySQL Server and MySQL Workbench

This process will get you a database server on your development PC, and a database client you can use to manage the database. There are enough details to this process that there is a separate blog post for it. You can find the instructions here:

Install MySQL Server and MySQL Community Workbench

Install MySQL Client Library

The MySQL client library is a native Linux library that allows programs to access MySQL Server and run SQL commands. As we have seen, it is not a prerequisite for running MySQL Workbench. However, it *is* a prerequisite for the Python MySQL client. If the native client is not installed before the Python libraries, the Python installs will fail. Execute the following command:

sudo apt install libmysqlclient-dev

Install Python Package Manager and Virtual Environment Support

We will be using pip as the package manager for Python, but pip is not included in the base Ubuntu Server install. We will also be using pipenv to provide virtual environment support for our demo application. Install these tools now:

sudo apt update
sudo apt install python3-pip
sudo apt install pipenv

Install Visual Studio Code

Visual Studio Code is a source-code editor that can be used with many programming languages, including Java, JavaScript, Go, Node.js, Python, C++, C, Rust and Fortran. One of its major advantages is that it runs equally well on Windows and Linux. It also has an extensive set of plug-ins, most of them free, that support compiling, debugging, and code analysis/Intellisense.

We will be using VS Code as our go-to tool for Python Development.

To install Code, we need to get it from a repository that is not included in the base install of Ubuntu Linux. So, a few commands are needed to add the repository to the set of repo’s used by apt before installing code itself. Follow these steps to install it on your Ubuntu Cloud PC:

sudo apt update

Install the wget tool so that we can use it to retrieve information about the new repository:

sudo apt install software-properties-common apt-transport-https wget

Use wget to download and install a repository key for apt:

wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -

Add the repository to the set of repo’s that apt searches for packages:

sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"

Finally, we can install code:

sudo apt install code

To verify the installation, go to Ubuntu Desktop, open up a terminal window (to your home folder), and enter:

code .

VS Code will start. You can trust the authors of both the current folder and the parent folder /home.

Install the Python Extension for VS Code

VS Code’s Python extension provides an extensive set of tools for working with Python. Like other VS Code extensions, it is simple to install:

  1. With VS Code open, click on Extensions at the left. then search for Python.
  2. When the Python extension appears, click on Install.