πŸ“‹ Getting Ready

2023/24 Autumn Term

Author

On this page, you will find information on how to set up your computer for this course, as well as practical advice on Python programming.

Set up your computer

Below you will find links to download and install the software that you will need for this course. If you prefer a more detailed guide, you can follow this guide created by our colleague Michael Wiemers from the LSE Digital Skills Lab.

Important

LSE Digital Skills Labs are also offering in-person workshops at the start of the 2023/24 academic year. We highly recommend you take these workshops if you are brand new to programming or need a refresher.

1. Install the bash terminal

Coding is like having a conversation with your computer’s hardware, such as the CPU, memory, and hard drive, instructing it on what to do. Programming languages like Python offer a high-level way to communicate with the computer, making it more accessible. However, understanding how to communicate with the computer at a fundamental level is essential. For instance, you should know how to run a Python script or install a new Python package. This is where the terminal comes into play.

We will delve into terminals further in πŸ—“οΈ Week 01 as well as πŸ’» Week 02 lab. Still, since you will need to use the terminal to install certain software for this course, it is crucial to set it up now. The following instructions will guide you through installing a specific terminal called bash on your computer.

Windows logo Windows users

Sadly, Windows command line interfaces differ from those used in Unix-based operating systems (Linux and macOS). Therefore, the commands we will learn today do not apply to Windows.

But fear not! Recent versions of Windows have a feature called Windows Subsystem for Linux, or WSL 1, which you can use to install Linux distributions. You just have to enable it first.

🎯 ACTION POINTS Follow Steps 1-4 of the tutorial β€œInstall Ubuntu on Wsl2 on Windows 11 with GUI Support.”

Apple logo macOS users

🎯 ACTION POINTS

  1. Open the terminal

  2. Now, to ensure you are using the bash shell, type the following and hit ENTER:

    echo $SHELL

    You can move to the next step if you see the following message on the terminal screen.

    /bin/bash
  3. If, instead, you saw the message below:

    /bin/zsh

    Then your computer came pre-packed with a different terminal called Z Shell. Read and follow the instructions in this tutorial to change your shell to bash 2.

2. Install Python

Python is a general-purpose programming language that is becoming increasingly popular in the social sciences. It is free and open-source and runs on Windows, Mac OS X, and Linux.

πŸ”— Link: Download Python from the Python Software Foundation.

3. Install miniconda

Just installing Python is not enough. You also need to install a lot of additional packages to be able to do data analysis in Python. The easiest way to do this is to install miniconda, a free and open-source package manager that allows you to install, run, and update Python packages.

πŸ”— Link: Download miniconda from the miniconda installation webpage.

Note: if you already have some experience with Python and have installed Anaconda, you can skip this step. Anaconda and miniconda are very similar, but Anaconda comes with a lot of additional packages that you probably don’t need and therefore uses more disk space. That is why we recommend using miniconda instead.

4. Install an IDE

Once you download Python, you can start using it straight away. All you need to do is type python (or python.exe if you are on Windows) in your terminal to start the Python interpreter. You can also write your Python scripts in any text editor and run them from the terminal with the python command. However, it is much more convenient to use an integrated development environment (IDE) that provides a graphical user interface (GUI) to Python.

In this course, we will use Visual Studio Code. Follow the instructions below to install it on your computer.

VS Code

Visual Studio Code (VS Code) is a very popular free and open-source IDE developed by Microsoft. It supports many programming languages, including Python, and comes with a lot of useful features, such as syntax highlighting, code completion, and debugging.

πŸ”— Link: Download Visual Studio Code from the VS Code website.

πŸ”— Link: Download the Python Extension for VS Code. Don’t forget to read the examples contained on that page to learn how to use the extension.

Tip

VS Code is very flexible.

You can install many extensions to add new features to the IDE. For example, you can install the GitHub Copilot extension to get AI-powered suggestions as you write your code or the Grammarly extension to check your spelling and grammar. You can find a list of the most popular VS Code extensions here.

Footnotes

  1. Microsoft Tutorial: β€œWhat Is Windows Subsystem for Linuxβ€β†©οΈŽ

  2. Curious about the different shells on Mac πŸ€“ ? Checkout the full article on β€œLearn Enough Tutorials: Using Z Shell on Macsβ†©οΈŽ