Getting Started

Lab 01

Author

Romi Hill

Published

September 9, 2026

1 Today

  1. Introductions & Logistics
  2. How to Use Python
    1. Python on the SCC
    2. Python in the Command Line
    3. Installing Python through miniconda

2 Introductions & Logistics

  • Email: romihill@bu.edu

  • Background:

    • 3rd PhD student in the Linguistics department
    • Primary interests in morphosyntax/morphophonology
    • BA in Linguistics and Mathematics
    • MA in Speech and Language Processing (Machine Language Track)
    • Employed as a Computational Linguist at Appen (company which develops linguistic datasets for AI/NLP tasks). Happy to talk about this experience if you have questions!
  • Structure of Lab Section:

    • Hands on practice, interactive
    • All lab materials will be published on this website. Always refer to Sophie’s Syllabus/Lectures/Announcements for anything related to homework and content (i.e. anything important)
    • Designed to help you with understanding content from the lectures
      • Please email me/approach me if there’s anything you would like to focus on!
      • Interrupt me at any moment if there’s anything that’s unclear/uncertain
  • Office Hours

    • Mondays 3:45pm - 4:45pm, Room 138M, 111 Cummington Mall
    • Sophie’s hours: Th 11:00–12:00, Room 138S, 111 Cummington Mall
      • Here to address any questions or problems you are stuck on
      • You can come with questions from the assignments, and I can give you hints/point you in the next direction

3 How to Use Python

To write/run Python, we need:

  1. A Python interpreter, which reads the Python code you have written
    • Can be installed through e.g. python.org, a “distribution” like miniconda
  2. A Code Editor, also known as an Integrated Development Environment or IDE
    • Popular examples include Visual Studio Code, Spyder, PyCharm

4 Installing Python with Anaconda

  • By the end of today, we will hopefully be able to run Python “locally” on your computer

    • This means you have Python installed on your computer

    • You can use Python interactively through the command line on your computer

    • The code runs on your own CPU/resources, and it reads/writes any files which are on your computer. This means you can use it without the internet and don’t need to rely on BU’s servers/your internet connection/etc

  • We will install Python using “Anaconda”, and use VSCode as an IDE

4.1 Introducing Anaconda

  • Distribution

    • A pre-packaged bundle of software that includes the Python interpreter, the standard library, and a variety of additional tools, packages, or utilities

    • Designed to make installing and using Python easier

  • Anaconda

    • A popular open-source Python distribution

    • Includes conda (package and environment manager), a vast collection of pre-installed scientific computing packages and the Anaconda Navigator

    • Can download the full distribution or “miniconda”

Anaconda vs. Miniconda

4.2 Instructions

4.2.1 Our Recommendation (need at least 10GB of Space)

  • Our strong recommendation is to install the full Anaconda Distribution, if you have the space.

Installing Full Distribution of Anaconda

4.2.2 If you don’t have 10GB of free space…

  • We need to install miniconda, which is a lightweight version of Anaconda

    • Unlike the full distribution, miniconda does not come with Jupyter Notebook, an IDE, or most extra packages pre-installed. We have to install those ourselves.

4.2.2.1 Step 1: Install Miniconda

  • Go to Miniconda Installer and download the installer for macOS

    • If you’re not sure whether your Mac has an Apple Silicon (M1/M2/M3/M4) or Intel chip, check the Apple menu > About This Mac
  • Open the downloaded .pkg file and follow the installer prompts (defaults are fine)

  • Open Terminal (search for it with Spotlight, Cmd + Space) and type:

    conda --version
    • If you see a version number printed, the install worked!
  • Go to Miniconda Installer and download the 64-bit installer for Windows

  • Run the downloaded .exe file

    • When prompted, we recommend selecting “Just Me” (not “All Users”)
    • On the Advanced Options screen, it’s okay to leave “Add Miniconda3 to my PATH environment variable” unchecked. Instead, we’ll use the Anaconda Prompt (installed automatically) to run conda commands
  • Open the Anaconda Prompt from the Start Menu (search “Anaconda Prompt”) — this is the command line you’ll use for the rest of these steps, instead of the regular Command Prompt or PowerShell

  • In the Anaconda Prompt, type:

    conda --version
    • If you see a version number printed, the install worked!

4.2.2.2 Step 2: Install Jupyter

  • In your Terminal (macOS) or Anaconda Prompt (Windows), type:

    conda install jupyter
    • Type y and press Enter when prompted to proceed
  • Test that it installed correctly:

    jupyter notebook --version

4.2.2.3 Step 3: Install VS Code

  • Download VS Code from code.visualstudio.com
  • Open the downloaded .zip file, then drag Visual Studio Code.app into your Applications folder
  • Open VS Code from Applications or Spotlight
  • Download VS Code from code.visualstudio.com
  • Run the downloaded installer
    • On the “Select Additional Tasks” screen, we recommend checking “Add to PATH” — this lets you open VS Code from the Anaconda Prompt by typing code
  • Open VS Code once installation finishes

4.2.2.4 Step 4: Set Up VS Code for Python

  • Open VS Code, and click the Extensions icon in the left sidebar (it looks like four squares)
  • Search for and install:
    • Python (published by Microsoft)
    • Jupyter (published by Microsoft)
  • Open or create a .ipynb (Jupyter Notebook) in VS Code
  • In the top-right corner, click “Select Kernel” (for a notebook) or check the bottom-right corner for the Python interpreter (for a script)
    • Choose your base conda environment — it should appear in the list as a conda environment
    • If you don’t see it, click “Select Another Kernel” > “Python Environments” and look for base
  • You’re ready to go! Try running a simple cell, e.g. print("hello world"), to confirm everything works

5 Introducing the SCC

  • SCC: Shared Computing Cluster
    • Connect with another computer, i.e. “server”
  • Access through here: (https://scc-ondemand1.bu.edu)
  • We can only interact with the server through the command line
  • The server has a file system, and we can upload files to it
  • This is a good backup to get Python running on your computer if the installation doesn’t work. This is also how you access BU’s powerful computers, so you will become familiar with it if you continue on with computational linguistics.

5.1 Demo: Let’s access the SCC! Under log in nodes, choose “_scc1”

Access SCC through login node
  • You can interact with the command line with the following bash commands. There are many others! It’s a powerful way to interact with your computer.
Bash Commands
Command What it does Example
cd Changes directory cd /projectnb/lx394sh/username
ls List contents of directory

ls

ls projectnb/lx394sh/username

pwd Print working directory pwd
mkdir Create a directory in current location mkdir my_dir_name
  • Let’s navigate to your student folders in the SCC!
  • You can use Python in the terminal as an “interactive interpreter”.

5.2 Demo: Using Python on the SCC!

  • We will use the VSCode server to access Python

  • Go back to https://scc-ondemand1.bu.edu, and click “interactive apps”, and “VS Code Server”

Access VS Code Server
  • From here, it is important that you you change the working directory to projectnblx394sh/students/your_username. Leave everything else the same.

Set working directory in VS Code Server
  • This is a good back up if you want to use Python, but haven’t set it up locally yet