Linux

Do these things once at the start of the semester

Install conda

Conda is a package manager that you will use to install python, along with a number of required tools.

Unlike many other applications on your computer, it is possible to install different versions of Conda in three different ways (with Anaconda, Miniconda, or Miniforge), all at the same time. This can be confusing and can lead to all sorts of trouble. So, unless you know what you are doing, we very strongly recommend two things:

  • Do not use Anaconda (so, uninstall it before doing anything else).
  • Use either Miniconda or Miniforge to install Conda exactly once.

First, to check if Anaconda is installed, open a terminal and run the following command:

which anaconda-navigator

If you see anything other than anaconda-navigator not found, then anaconda is installed. Follow these instructions (including the optional steps to remove “conda initialization scripts” and to remove “hidden directories”) to uninstall it:

How to open a terminal

When we say “open a terminal,” what we mean is to start the Terminal application. One way to do that on many linux distributions is to use the keyboard shortcut ctrl-alt-t.

Note that it is often helpful to have more than one terminal window open at the same time (or more than one tab in the same window).

How to run a command

When we say “run a command,” what we mean is to type something into the terminal window and press enter.

Second, to check if either Miniconda or Miniforge is installed, open a terminal and run the following command (it tries to update whatever is installed — Miniconda or Miniforge — to its latest version, something you should do from time to time anyway):

conda update -n base conda

If this process succeeds, then either Miniconda or Miniforge is installed.

Third, to install Miniforge (do this only if neither Miniconda nor Miniforge was installed!), follow these instructions, which require only running the following commands in a terminal:

curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3-$(uname)-$(uname -m).sh -b -p "${HOME}/miniforge3"
rm Miniforge3-$(uname)-$(uname -m).sh
~/miniforge3/bin/conda init bash
~/miniforge3/bin/conda init zsh

Please check very carefully (by reading the output in the terminal) that all five of these commands ran to completion without producing any errors. If you see any errors, ask us for help before doing anything else.

After running these commands (error-free!), close your terminal and open a new one before proceeding to the next step.

Get the code

Open a terminal and change the working directory to a folder in which you would like to put all your files. Then, use git to download the code from our ae353 github repository by running this command:

git clone https://github.com/tbretl/ae353-sp25.git

This process will take very little time. When it completes, you should find a new folder called ae353-sp25 inside your working directory.

How to change the working directory

All the files on your computer are organized in folders, which are commonly referred to as “directories.” When you are working on the command line in a terminal, you are working in one of these directories. Commands you run can find files in that directory, but cannot (by default) find files in other directories.

When we say “change the working directory,” we mean exactly that — telling the terminal the directory in which you want to work.

To do this, we run the command

cd path/to/directory

where “path/to/directory” is replaced by the location of the directory in which you want to work. Since you are using linux, we assume you know all about this already. If that’s not the case and you have questions, ask us for help.

Create a conda environment

An “environment” is like a sandbox where you can install software without causing any conflict with other things you might have installed on your computer. To create an environment for work in AE353, change your working directory to ae353-sp25 (wherever you put the code). Then, run this command:

conda env create -f environment.yml

You may see something like WARNING: A conda environment already exists and be asked if you want to Remove existing environment. This means that you already created an environment called ae353. Perhaps something went wrong and you are creating it again — in this case, type y to remove the existing environment and proceed to recreate it. From then on, accept all default options.

Make sure that this process completes successfully. If you see any errors, ask for help.

Install VS Code

Visual Studio Code (aka VS Code) is the cross-platform code editor that we recommend for use with this course.

To install VS Code, follow the instructions for Installation from the Visual Studio Code on Linux setup page.

To run VS Code, open a terminal, change the working directory to wherever you have your files, and run the command code . (i.e., the word “code”, then a space, then a period).

This semester, you will primarily be using VS Code to work with jupyter notebook files (.ipynb). This requires installing the Python Extension and the Jupyter Extension to VS Code. To do this, open VS Code if you haven’t already, then click on Extensions in the toolbar on the left side of the window.

Install the python extension as follows:

  • Type “python” into the search bar.
  • Click on Python (it should be at the top of the list).
  • Click on Install in the window that opens.

Install the jupyter extension as follows:

  • Type “jupyter” into the search bar.
  • Click on Jupyter (it should be at the top of the list).
  • Click on Install in the window that opens.

Do these things every day before you start your work

Change your working directory

Open a terminal and change your working directory to ae353-sp25, wherever you put this.

Activate your conda environment

Run this command:

conda activate ae353

You should see the prefix to your terminal prompt change from (base) to (ae353). This means you are in the conda environment you created for work with AE353.

Get the latest version of the code

Run this command:

git pull

Do not worry, this will not overwrite any of your own work. If you see any errors or warnings, post a note to the discussion forum on canvas and course staff will help resolve them.

Start a jupyter notebook

Run this command to open VS Code:

code .

You can now open and work with any notebook (or other file) that you like.

As an alternative to VS Code, if you like, you can also work with jupyter notebooks in a browser window. To do so, and run this command:

jupyter notebook

A browser window should open with the jupyter notebook interface. You can now navigate to and open any of the notebooks (with extension .ipynb) used for in-class examples or for design projects.

In either case, we strongly recommend you duplicate and work with a copy of any given notebook rather than working with the original. Feel free to ignore this suggestion if you are a git expert.