Setting Up Your Computer

The goal is to install basic Python software on your laptop so you don't have to depend on anything external from your computer to start programming.

Part 1: The Computing Environment

We've intentionally chosen software that is freely available and somewhat easy to install on a "normal" computer setup.

Step 1: Install WSL (Windows Subsystem for Linux), a terminal environment that runs the Ubuntu Linux operating system.

  1. Open your "Powershell" program by typing Powershell into your Windows bar, then click "Run as administrator"
  2. Paste this command:
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  3. Restart your computer (type 'Y' if it asks)
  4. Open the "Software Center" and search for "Ubuntu 20.04 LTS" under Applications.
  5. Click Ubuntu 20.04 and then click its "Install" button. Close the Software Center when installed.
  6. Open your newly installed "Ubuntu"! Wait through any further installation. After it starts up, enter your m2XXXXX username and choose a simple/dumb password. You must use your USNA username. The password doesn't really matter. Keep it simple.
  7. Close Ubuntu.

Step 2: Directory and file setup

Directory setup. You have Ubuntu now, but let's set it up so that it starts in an SD211 folder, and has important programs. Open Ubuntu again. Copy/paste the entire following text into your terminal and hit enter.

curl https://www.usna.edu/Users/cs/nchamber/courses/sd211/sd211setup.txtsh | bash

The above will take several minutes. When finished, run this second command:

bash Anaconda3-2022.05-Linux-x86_64.sh

Use SPACEBAR to scroll the agreement. Type "yes" at the end of the agreement. Hit ENTER on other prompts. Type "yes" at the end.

While you wait... you can move on to Step 3 and leave this running.

When this finishes... close and restart Ubuntu. When it starts up, you should see this (but with your username not 'nchamber'):

Step 3: Install VS Code

VSCode is a free/popular programming environment for Python (and other languages!).

  1. Visit code.visualstudio.com
  2. Click the big Download For Windows button.
  3. Run the downloaded file to install. Click through the default options.
  4. Open VSCode (pick a Light/Dark theme on the startup screen).
  5. Close the "Get Started" window (x on its tab at the top).
  6. Click the "Extensions" icon on the left pane (4 squares). You will install an extension.
  7. Close the Extensions.
  8. Click the green icon on the very bottom left. Select "New WSL Window". A window will open and should look like this:
  9. We'll now install one more extension. Click the "Extensions" icon. Type "Python". Click the Python button, and then the "Install in WSL" button on the main page. See here:

Step 4: Install Xming

Install Xming, a program that lets you display graphical interfaces. Just visit Xming and click the green Download button. Click the downloaded .exe file and "Run as Administrator" and click through the install buttons.

Step 5: Setup VS Code for Remote Lab Machines

You can use your laptop to edit/run your programs that you wrote in the lab!

First, setup Windows to allow remote connections with GUIs.

Now we'll setup VS Code.