Appendix 1.1: Linux & WSL#

In this course, we will use a Linux command-line environment to install, configure, and manage the software needed for our Python-based data science work. Rather than relying on graphical tools, we will use basic Linux (bash) commands to interact directly with the operating system that hosts our Python environments. On Windows systems, this means installing and working inside the Windows Subsystem for Linux (WSL), which provides a lightweight Linux environment on your computer. This appendix focuses on installing WSL and learning the essential Linux commands we will use throughout the course; the next appendix covers installing Miniconda and creating Python environments within that system.

1. Installing Linux via WSL#

Note (Mac users): You do not need to install WSL if you are using macOS. macOS already provides a Unix-based terminal that can run the Linux command-line tools used in this course.

Before installing WSL, ensure your computer meets these requirements:

  • 50-100 GB of free space on your hard drive

  • At least 8 GB RAM for basic usage and exercises in this class

  • 16 GB RAM or more recommended for intensive machine learning activities

  • Windows 10 version 2004 or higher, or Windows 11

  • Administrative privileges on your computer

By default, WSL installs the Ubuntu distribution of Linux, which is what we will use in this course. While WSL can run on traditional hard drives (HDDs), an SSD is strongly recommended for better performance.

1.1 WSL Installation Instructions:#

  1. Type: "Windows PowerShell" in the Windows search bar

  2. Type: wsl --install

  3. Type: exit

For additional information see

Once installed you can start Ubuntu through the Windows search bar (by typing Ubuntu).

Note: If you see an error such as:

WslRegisterDistribution failed with error: 0x80370102 Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.
See Notes: Enable Virtualization at the end of this appendix

1.2 Starting Ubuntu#

The first time you start Ubuntu, you will be prompted to:

  • Enter a new Unix username (lowercase only)

  • Enter a new password

Note: WSL allows multiple Linux distributions to be installed. In this course, we will use Ubuntu only.

1.3 Why use WSL instead of Windows alone?#

Although Conda can be installed directly on Windows, we will use WSL for several reasons:

  1. Many Python scientific libraries are better supported on Linux than on Windows

  2. Linux is the standard environment for open-source scientific software

  3. WSL integrates Linux with the Windows file system without requiring dual-booting

  4. Python scripts often run faster under WSL than in a native Windows setup

  5. Using a Linux environment ensures that the command-line instructions in this course are consistent across Windows (via WSL), macOS, and Linux systems

  6. Learning basic Linux and bash commands is a valuable and transferable skill

1.4 WSL Ubuntu Password Recovery#

Some commands like sudo require a password. If you forget it you can reset your WSL password through Windows PowerShell.

  1. Open PowerShell or Windows Command Prompt as an Administrator

  2. type: wsl -u root

  3. type: passwd <username> where is your username

  4. Enter and confirm new password when prompted

  5. type: exit

2. Linux and Bash Basics#

Linux is a family of open-source operating systems widely used in scientific computing, data science, and software development. In this course, Linux provides the operating system layer that hosts our Python environments and scientific software.

On Windows, we access Linux using Windows Subsystem for Linux (WSL), which runs the Ubuntu distribution. On macOS and Linux systems, Linux-style command-line tools are already available through the system terminal. Although the installation steps differ slightly by platform, the commands we use throughout the course are the same.

We will interact with Linux almost entirely through the command line, using a shell called bash (Bourne Again SHell). Bash allows us to run programs, manage files, and control software environments in a precise and reproducible way.

2.1 Command Line Interface (CLI): The Terminal#

In this class, the Linux command line is used to:

  1. Update system-level software required for scientific tools

  2. Install Miniconda, which manages Python versions and packages

  3. Create and manage isolated Python environments

  4. Launch Jupyter Lab and other tools from the terminal

  5. Navigate and organize project directories and data files These tasks form the foundation of a reproducible scientific computing workflow.

Conceptual Model

  • Terminal: the application window where you type commands

  • Shell: the program that interprets those commands (bash, in our case)

  • Kernel: the core of the operating system that manages memory, processes, and hardware

In Ubuntu (including WSL), the default interactive shell is bash. macOS also uses bash (or a compatible shell), so most commands are identical across platform

2.2 Opening a Terminal#

Windows (WSL / Ubuntu)

  • Type Ubuntu into the Windows search bar and open it

  • You may pin Ubuntu to the taskbar for convenience

macOS

  • Press <Command + Space>, type Terminal, and press Enter

  • Or navigate to Applications → Utilities → Terminal

2.3 Updating System Packages (Linux / WSL Only)#

Before installing new software, it is good practice to update the system package list.

sudo apt update && sudo apt upgrade

What this does:

  • sudo — run the command with administrative privileges

  • apt — Ubuntu’s package manager

  • update — refreshes the list of available software versions

  • upgrade — installs newer versions of already installed packages

  • && — runs the second command only if the first succeeds

You will be prompted for your Linux password. macOS users do not run this command.

We keep this step brief here because *most software installation in this course happens through Conda, not through the system package manager.

%%html
# this is a code cell that connects to a youtube, and you need to execute it the first time you start the kernel with shift-enter.


<iframe width="560" height="315" src="https://www.youtube.com/embed/zAanEBEc7ZU?si=i8oHwcRcTcwKchOt" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
# this is a code cell that connects to a youtube, and you need to execute it the first time you start the kernel with shift-enter.

2.4 Essential Bash Commands (Reference)#

The following commands are used repeatedly throughout the course. You should return to this table as needed.

2.4.2 File and Directory Management#

Command

Description

mkdir <name>

Create a directory

rm <file>

Remove a file

rm -r <dir>

Remove directory and contents

mv <src> <dest>

Move or rename files

cp <src> <dest>

Copy files

exit

Close the terminal session

Use rm -r carefully. It permanently deletes files.

2.5 Notes on Software Installation#

In this course, Conda is the primary tool for installing Python packages and managing environments. When possible:

  • Prefer conda install <package>

  • Use pip install <package> only when a package is not available through Conda

We will cover this workflow in detail in the next appendix.

2.6 Further Learning Resources#

These resources provide deeper introductions to the command line and are useful throughout the semester:

Notes: Enable Virtualization#

If you need to enable virtualization in your bios you may need to search online for instructions for your particular computer, there are multiple good videos and the process is relatively straightforward, but it can vary from computer to computer.

Common manufacturers and their BIOS/UEFI access keys.

  • Dell: F2 or F12

  • HP: Esc or F10

  • Lenovo: F1, F2, or a physical Novo Button

  • Acer: F2 or Delete

Enable Virtualization in Windows 10#

Geeks for Geeks Tutorial

  1. Check Virtualization Status Open Task Manager (Ctrl + Shift + Esc). Navigate to the Performance tab. Look for Virtualization under the CPU section. If it says “Disabled,” proceed to enable it in the BIOS/UEFI.

  2. Access BIOS/UEFI Restart your computer and press the appropriate key during boot (commonly F2, F12, Delete, or Esc). For Dell, use F2 or F12. If your system boots too quickly, access the advanced startup menu: Go to Settings → Update & Security → Recovery. Under Advanced Startup, click Restart Now. Select Troubleshoot → Advanced Options → UEFI Firmware Settings → Restart.

  3. Enable Virtualization In the BIOS/UEFI interface, navigate to the Advanced, Configuration, or Processor tab (varies by system). Look for virtualization settings, such as: Intel Virtualization Technology or AMD SVM Mode. Enable the setting, save changes (usually F10), and exit.

Enable Virtualization Windows 11:#

BlueStacks Tutorial

  1. Check Virtualization Status Same process as Windows 10 via Task Manager.

  2. Access BIOS/UEFI Restart your computer and press the appropriate key during boot (commonly F2, F12, Delete, or Esc). Use the advanced startup menu for faster systems: Go to Settings → System → Recovery. Under Advanced Startup, click Restart Now. Select Troubleshoot → Advanced Options → UEFI Firmware Settings → Restart.

  3. Enable Virtualization Follow the same steps as in Windows 10 to locate and enable virtualization.