diff --git a/_includes/copilot-setup.html b/_includes/copilot-setup.html new file mode 100644 index 0000000..9ae64ce --- /dev/null +++ b/_includes/copilot-setup.html @@ -0,0 +1,23 @@ +
+

Setting up GitHub Copilot in VSCode

+ +

+ In any VSCode window, click the Copilot icon near the bottom left corner of the bottom status bar and select "Use AI Features", + then follow the prompts to sign in using GitHub. +

+

+ Copilot status bar +

+ +

+ This will give you access to the [Copilot free plan](https://docs.github.com/en/copilot/concepts/billing/individual-plans) in VSCode. +

+ +

+ To open the Copilot chat, go to **View > Chat**. +

+ +

+ Reference: https://code.visualstudio.com/docs/copilot/setup +

+
diff --git a/_includes/extra-git-setup.html b/_includes/extra-git-setup.html index 72b7786..600b6b7 100644 --- a/_includes/extra-git-setup.html +++ b/_includes/extra-git-setup.html @@ -3,21 +3,30 @@

Git configuration

If you have never used Git on your computer, you may have to configure it. - The following instructions assume you have already created a GitHub account. + The following instructions assume you have already created a GitHub account following the main Setup page.

- Type the following commands in a terminal. Make sure to use the email associated with your GitHub account. - The user.name can be any name you want to appear as the author of your commits, but we recommend using the name associated with your GitHub profile. + Type the following commands in a terminal.

+ + +

Notes:

+ +

-git config --global user.name "Jane Doe"
-git config --global user.email "janedoe@example.com"
-git config --global core.autocrlf true
+git config --global user.name "Jane Doe"  # Set the author name for your commits
+git config --global user.email "janedoe@example.com"  # Set the email linked to your commits
+git config --global core.autocrlf true  # Auto-handle line endings correctly across different OSes
+git config --global init.defaultBranch main  # Make new repos use "main" as the default branch name
+git config --global pull.rebase false  # Make "git pull" combine changes using merge by default
 

- Tip: You can review your configuration at any time with: git config --list + Tip: You can check your Git configuration at any time with: git config --list

diff --git a/_includes/gh-ssh-key-setup.html b/_includes/gh-ssh-key-setup.html index e8e9171..825b5a7 100644 --- a/_includes/gh-ssh-key-setup.html +++ b/_includes/gh-ssh-key-setup.html @@ -5,13 +5,13 @@
  • In a terminal, check if you have existing SSH keys in the ~/.ssh directory. A public/private key pair typically has the filename format id_ALGORITHM and id_ALGORITHM.pub. - If you have existing key files, use a custom name for your SSH key pair in step 2. + If you have existing key files, use a different, custom name for your SSH key pair in step 2.
  • Generate a new SSH key and add it to the ssh-agent.
  • @@ -30,7 +30,7 @@ Locally specify the SSH key to use when connecting to GitHub, so that the right "identity" is always used for local Git operations (useful when you have multiple keys).
    1. - Run the following command (replace id_ed25519 with your private key's filename if you used a custom key name): + Run the following command (if you used a custom key name, replace id_ed25519 with your private key's filename):
      printf 'Host github.com\n  User git\n  IdentityFile ~/.ssh/id_ed25519\n  IdentitiesOnly yes\n' >> ~/.ssh/config
    2. @@ -40,8 +40,7 @@
      Host github.com
         User git
         IdentityFile ~/.ssh/id_ed25519
      -  IdentitiesOnly yes
      -          
      + IdentitiesOnly yes
  • diff --git a/_includes/setup-python-package.html b/_includes/setup-python-package.html index 8dd111f..7ce7c3e 100644 --- a/_includes/setup-python-package.html +++ b/_includes/setup-python-package.html @@ -2,9 +2,9 @@

    -conda config --append channels conda-forge
    -conda config --set channel_priority strict
    -conda create -n qlsc612 -y python=3.12 flake8 jupyterlab jupyter nilearn matplotlib seaborn bokeh statsmodels plotly wordcloud
    +conda config --append channels conda-forge  # add conda-forge as a source for packages (channel)
    +conda config --set channel_priority strict  # prioritize packages based on channel order
    +conda create -n qlsc612 -y python=3.12 flake8 jupyter nilearn matplotlib seaborn bokeh statsmodels plotly wordcloud
     conda activate qlsc612
     

    @@ -16,3 +16,8 @@ The last line, conda activate qlsc612, will activate this Python environment (the default environment is base).

    + +

    +Once the commands have finished running, you should see `(qlsc612)` at the beginning of your terminal prompt +to indicate that the new environment is active. +

    diff --git a/_includes/vs-code-workspace-trust-popup.html b/_includes/vs-code-workspace-trust-popup.html new file mode 100644 index 0000000..82c929f --- /dev/null +++ b/_includes/vs-code-workspace-trust-popup.html @@ -0,0 +1,12 @@ +
    +

    + NOTE: + The first time you run code . in a folder, + you may see a popup asking "Do you trust the authors of the files in that folder?" +

    +

    + Select "Yes, I trust the authors", and if available, also check the box that says + "Trust the authors of all files in the parent folder". + This will enable full features and extensions in your VSCode workspace. +

    +
    diff --git a/assets/images/setup-copilot-status-bar.png b/assets/images/setup-copilot-status-bar.png new file mode 100644 index 0000000..7bf0424 Binary files /dev/null and b/assets/images/setup-copilot-status-bar.png differ diff --git a/setup/linux.md b/setup/linux.md index ef54e7a..3b48bb6 100644 --- a/setup/linux.md +++ b/setup/linux.md @@ -6,7 +6,7 @@ description: Instructions for setting up on Linux ### Bash shell -You already have it! Depending on which version of Linux you’re running you may +You already have it! Depending on which version of Linux you're running you may need to type `bash` inside the terminal to access it. To check whether this is necessary, follow these steps: @@ -25,9 +25,9 @@ If you are prompted to install it follow the instructions on-screen to do so. {% include extra-git-setup.html %} -#### Creating an SSH key for GitHub +#### Create an SSH key for GitHub -When following the GitHub docs below, make sure to select the **Linux** instructions. +When following the GitHub docs in the steps below, make sure to select the **Linux** instructions at the top of the page. {% include gh-ssh-key-setup.html %} @@ -35,18 +35,24 @@ When following the GitHub docs below, make sure to select the **Linux** instruct 1. Go to [this page](https://code.visualstudio.com/) and click the download button for either the `.deb` (Ubuntu, Debian) or the `.rpm` (Fedora, CentOS) file. -1. Double-click the downloaded file to install VSCode +2. Double-click the downloaded file to install VSCode (you may be prompted to type your administrator password during the install). +3. To confirm that everything worked, open a terminal and type `code .` (include the period). + This should open the current directory in a VSCode window. + +{% include vs-code-workspace-trust-popup.html %} #### VSCode extensions 1. Open the Visual Studio Code application. -1. Open the Extension side panel by pressing `Ctrl+Shift+X`. +2. Open the Extension side panel by pressing `Ctrl+Shift+X`. In the search bar at the top of this panel search for each of the following extensions and press `Install` for the first entry that appears. {% include vs-code-extensions.html %} +{% include copilot-setup.html %} + ### Python 1. Open a new terminal and type the following lines (separately) into the @@ -57,23 +63,23 @@ When following the GitHub docs below, make sure to select the **Linux** instruct bash Miniconda3-latest-Linux-x86_64.sh ``` -1. A license agreement will be displayed and the bottom of the terminal will read `--More--`. +2. A license agreement will be displayed and the bottom of the terminal will read `--More--`. Press `Enter` or the space bar until you are prompted with - "Do you accept the license terms? [yes|no]." - Type `yes` and then press `Enter` -1. The installation script will inform you that it is going to install into a default directory (e.g., `/home/$USER/miniconda3`). + `Do you accept the license terms? [yes|no]`. + Type `yes` and then press `Enter`. +3. The installation script will inform you that it is going to install into a default directory (e.g., `/home/$USER/miniconda3`). Leave this default and press `Enter`. -1. When you are asked - "Do you wish the installer to initialize Miniconda3 by running conda init? [yes|no]," +4. When you are asked + `Do you wish the installer to initialize Miniconda3 by running conda init? [yes|no]`, type `yes` and press `Enter`. Exit the terminal once the installation has finished. -1. Re-open a new terminal. - Type `which python` into the terminal and it should return a path (e.g., `/home/$USER/miniconda3/bin/python`). - - If you do not see a path like this then please try typing `conda init`, +5. Re-open a new terminal. + Type `which python` into the terminal and check that it returns a path like `/home/$USER/miniconda3/bin/python`. + - If you do not see a path like this, try typing `conda init`, closing your terminal, and repeating this step. If your issue is still not resolved skip the following step and contact an instructor on the `#help-installation` channel of the Slack workspace. -1. Type the following to remove the installation script that was downloaded: +6. Type the following to remove the installation script that was downloaded: ```bash rm ./Miniconda3-latest-Linux-x86_64.sh @@ -90,13 +96,24 @@ When following the GitHub docs below, make sure to select the **Linux** instruct [Debian](https://docs.docker.com/engine/install/debian/), [Fedora](https://docs.docker.com/engine/install/fedora/), [CentOS](https://docs.docker.com/engine/install/centos/)). Make sure to - follow the “Install using the repository” method! -1. Once you’ve installed Docker make sure to follow the + follow the "Install using the repository" method! +2. Once you've installed Docker make sure to follow the [post-install instructions](https://docs.docker.com/engine/install/linux-postinstall/) - as well. You only need to do the “Manage Docker as a non-root user” and - “Configure Docker to start on boot” steps. -1. Open a new terminal and type `docker run hello-world`. A brief introductory - message should be printed to the screen. + as well. You only need to do the "Manage Docker as a non-root user" and + "Configure Docker to start on boot" steps. +3. Open a new terminal and type `docker run hello-world`. + If the installation worked, a brief introductory message should be printed to the screen. + +### Install the `tree` command + +`tree` is a helpful command for viewing directory structures, and is strongly recommended. + +1. Open a terminal, and check if you have `tree` already installed by running `tree --version`. + - If you see a version number, you're all set! + - If you see a message like `tree: command not found`, install it by running: + ```bash + sudo apt-get update && sudo apt-get install -y tree + ``` --- diff --git a/setup/mac.md b/setup/mac.md index 5dca138..07460b6 100644 --- a/setup/mac.md +++ b/setup/mac.md @@ -6,17 +6,26 @@ description: Instructions for setting up on Mac ### Bash shell -You already have it! Depending on which version of Mac OS you’re running you may -need to type `bash` inside the terminal to access it. To check whether this is -necessary, follow these steps: +On Mac OS, you already have a `bash` shell installed! +However, depending on your OS version, you may have a different _default_ shell (e.g., `zsh`). -1. Open a terminal and type `echo $SHELL`. If it reads `/bin/bash` then you are - all set! +To check your default shell, open a terminal and type `echo $SHELL`. +If the output reads `/bin/bash`, you are all set! -Note: If you are using Mac Catalina (10.15.X) or later, then it is possible your default -shell is NOT CORRECT. To set the default to bash, type `chsh -s /bin/bash` in -the terminal, enter your password when prompted, and then close + re-open the -terminal. +If the output is something else (e.g., `/bin/zsh`), we strongly recommend changing your default shell to `bash` for this course. +To do so, + +1. Run: + ```bash + chsh -s /bin/bash + ``` +2. Enter your password when prompted. +3. Close and re-open the terminal. +4. Run `echo $SHELL` again to confirm it now shows `/bin/bash`. + +All instructions in the course will assume you are using `bash`. + +> **Note**: After the course, you can switch back to your original shell using `chsh -s /bin/zsh` (or whatever your original shell was). ### Homebrew @@ -41,40 +50,48 @@ In the terminal, run: brew install git ``` -(If you already installed `git` through the Xcode Command Line Tools, that is fine, so you don't need to worry.) +(If you already installed `git` through the Xcode Command Line Tools, don't worry, that is fine.) Verify the installation by running `git --version`: this time you should see something like `git version X.XX.X`. {% include extra-git-setup.html %} -#### Creating an SSH key for GitHub +#### Create an SSH key for GitHub -When following the GitHub docs below, make sure to select the **Mac** instructions. +When following the GitHub docs in the steps below, make sure to select the **Mac** instructions at the top of the page. {% include gh-ssh-key-setup.html %} ### VSCode -1. Go to [this page](https://code.visualstudio.com/) and click the download button. -1. Unzip the downloaded file (for example, `VSCode-darwin-universal.zip`) and move the resulting `Visual Studio Code` file to your Applications directory. +1. On this [page](https://code.visualstudio.com/docs/setup/mac#_install-vs-code-on-macos), follow all steps in the following two sections **only**: + - [Install VS Code on MacOS](https://code.visualstudio.com/docs/setup/mac#_install-vs-code-on-macos) + - To begin the download, click on the "Download Visual Studio Code" link + - [Launch VS Code from the command line](https://code.visualstudio.com/docs/setup/mac#_launch-vs-code-from-the-command-line) + - Use the method "Configure the path with VS Code" to set up the `code` command in your terminal + + You can skip all other sections on that page. + +2. To confirm that everything worked, open a terminal and type `code .` (include the period). +This should open the current directory in a VSCode window. + +{% include vs-code-workspace-trust-popup.html %} #### VSCode extensions -1. Open the Visual Studio Code application -1. Type `Cmd+Shift+P` to open the "command palette" at the top of the screen and then enter - `Shell command: Install 'code' command in PATH`. - Select the highlighted entry. - A notification box should appear in the bottom-right corner indicating that the command was installed successfully. -1. Open the Extension side panel by pressing `Cmd+Shift+X`. +1. Open the Visual Studio Code application. +2. Open the Extension side panel by pressing `Cmd+Shift+X`. In the search bar at the top of this panel search for each of the following extensions and press `Install` for the first entry that appears. {% include vs-code-extensions.html %} +{% include copilot-setup.html %} + ### Python 1. Open a new terminal and type the following command, then press `Enter`. - - If you are on an Apple Silicon Mac (upper left corner Apple menu  -> `About This Mac` says something like "Chip: Apple M1" (or M2, etc.)): + - If you are on an Apple Silicon Mac (upper left corner Apple menu -> `About This Mac` says something like "Chip: Apple M1" (or M2, etc.)): ```bash curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh ``` @@ -83,22 +100,22 @@ When following the GitHub docs below, make sure to select the **Mac** instructio curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh ``` -1. Run the installation script: +2. Run the installation script: ```bash bash Miniconda3-latest-MacOSX-x86_64.sh ``` - A license agreement will be displayed and the bottom of the terminal will read `--More--`. - Press `Enter` or the space bar until you are prompted with "Do you accept the license terms? [yes|no]." - Type `yes` and then press `Enter` - - The installation script will inform you that it is going to install into a default directory (e.g., `/Users/$USER/miniconda3`). + Press `Enter` or the space bar until you are prompted with `Do you accept the license terms? [yes|no]`. + Type `yes` and then press `Enter`. + - The installer will show a default installation directory (e.g., `/Users/$USER/miniconda3`). Leave this default and press `Enter`. - - When you are asked "Do you wish the installer to initialize Miniconda3 by running conda init? [yes|no]," type `yes` and press `Enter`. + - When you are asked `Do you wish the installer to initialize Miniconda3 by running conda init? [yes|no]`, type `yes` and press `Enter`. - Exit the terminal once the installation has finished. -1. Re-open a terminal. - Type `which python` into the terminal and it should return a path (e.g., `/Users/$USER/miniconda3/bin/python`). - - If you do not see a path like this then please try typing `conda init`, closing your terminal, and repeating this step. - If your issue is still not resolved. skip the following step and contact an instructor on the #help-installation channel of the QLS612-BHS Slack. -1. Type the following to remove the installation script that was downloaded: +3. Re-open a terminal. + Type `which python` into the terminal and check that it returns a path like: `/Users/$USER/miniconda3/bin/python`. + - If you do not see a path like this, try typing `conda init`, closing your terminal, and repeating this step. + If your issue is still not resolved, skip the following step and contact an instructor on the #help-installation channel of the QLS612-BHS Slack. +4. Type the following to remove the installation script that was downloaded: ```bash rm ./Miniconda3-latest-MacOSX-x86_64.sh @@ -123,12 +140,23 @@ When following the GitHub docs below, make sure to select the **Mac** instructio Wait until it reads `Docker Desktop is now up and running!` 1. Open a new terminal and type `docker run hello-world`. - A brief introductory message should be printed to the screen. + If the installation worked, a brief introductory message should be printed to the screen. The above step-by-step Docker instructions are distilled from [here](https://docs.docker.com/desktop/setup/install/mac-install/). If you have questions during the installation procedure please check that link for potential answers! +### Install the `tree` command + +`tree` is a helpful command for viewing directory structures, and is strongly recommended. + +1. Open a terminal, and check if you have `tree` already installed by running `tree --version`. + - If you see a version number, you're all set! + - If you see a message like `tree: command not found`, install it by running: + ```bash + brew install tree + ``` + --- diff --git a/setup/setup.md b/setup/setup.md index a4fc295..0ce2d10 100644 --- a/setup/setup.md +++ b/setup/setup.md @@ -25,8 +25,8 @@ steps you can take to ensure you are ready for the lectures. ## Required software -To get the most out of our course, please arrive with the -software listed below **already installed** (or to the best of your ability). +To get the most out of our course, **please arrive with the +software listed below already installed** (or to the best of your ability). The rest of this page provides installation procedures for each of the above programs, including specific instructions for each of the three major operating systems (Windows, Mac OS, and Linux). @@ -38,7 +38,6 @@ operating systems (Windows, Mac OS, and Linux). - A virtualization system: Docker - A GitHub account - Slack -- Zoom - A modern browser ### Some quick general notes on instructions @@ -56,12 +55,12 @@ operating systems (Windows, Mac OS, and Linux). ### GitHub account -Go to [https://github.com/join/](https://github.com/join/) and follow the -on-screen instructions to create an account. -We recommend associating this -with your university e-mail (if you have one) as this will entitle you to sign -up for the [GitHub Student Developer Pack](https://education.github.com/pack) -which comes with some nice free bonuses. +1. Follow the instructions at [https://github.com/join/](https://github.com/join/) to create an account. +We recommend using your university e-mail for the account if you have one (you can always change it later or add a secondary e-mail). + +2. We strongly recommend also signing up for [GitHub Education Student](https://github.com/education/students), +which provides free access to perks and tools including the [GitHub Student Developer Pack](https://education.github.com/pack). +The application process is very quick, and verification typically takes no more than a couple days at most. ### Slack @@ -69,18 +68,15 @@ Go to [https://slack.com/downloads/](https://slack.com/downloads/) and download -### Zoom - -Go to [https://zoom.us/download](https://zoom.us/download) and download and install the Zoom client. - ### Modern web browser Install Firefox, Chrome, or Safari. ### OS-specific installation instructions -Select the link that corresponds to your operating system and follow the -instructions provided. Please direct any questions to the `#help-installation` +Once you have completed the above general setup, select the link that corresponds to your operating system and follow the +instructions provided. +Please direct any questions to the `#help-installation` channel in the QLS612 Slack. - [Linux]({{ site.url }}/setup/linux.html) diff --git a/setup/windows.md b/setup/windows.md index 878d242..fb06aa9 100644 --- a/setup/windows.md +++ b/setup/windows.md @@ -6,7 +6,7 @@ description: Instructions for setting up on Windows ### WSL2 (Windows Subsystem for Linux version 2) -WSL (Windows Subsystem for Linux) allows you to use Linux on top of Windows +WSL (Windows Subsystem for Linux) lets you use Linux on top of Windows natively. WSL2 is the latest version of WSL and is more stable with improved performance and compatibility. If you already have WSL(1), it is easy to convert to WSL2 (see [Instructions to convert WSL(1) to WSL2](https://learn.microsoft.com/en-us/windows/wsl/install#upgrade-version-from-wsl-1-to-wsl-2)). @@ -29,7 +29,7 @@ see the "Install WSL2 on Windows 10 (older versions)" section on this [page](htt Select `Yes` on the prompt that appears asking if you want to allow the app to make changes to your device. 5. At this point, if you are on a newer version of Windows 10 or Windows 11, the command from Step 2 should have installed, in addition to WSL, - the latest LTS version of Ubuntu (24.04 LTS at time of writing) as the default distribution. + the latest LTS version of Ubuntu (26.04 LTS at time of writing) as the default distribution. If this is the case, an Ubuntu terminal will open to resume automatic setup, and afterwards will ask you set up a username and password. **If this applies to you, skip to Step 9. @@ -41,7 +41,7 @@ see the "Install WSL2 on Windows 10 (older versions)" section on this [page](htt wsl --list --online ``` -7. Type the following command to install a specific distro (Ubuntu-22.04 +7. Type the following command to install a specific distro (Ubuntu-26.04 recommended) in WSL and press `Enter` (it will start the distro if it has already been installed): @@ -51,18 +51,19 @@ see the "Install WSL2 on Windows 10 (older versions)" section on this [page](htt 8. Restart your computer, open **Start (Win key)** and search for **Ubuntu**, and click on the app called **Ubuntu** or **Ubuntu \**. You should now have - the **WSL2 Ubuntu 22.04** terminal open. Now, you are ready to rock! + the **WSL2 Ubuntu 26.04** terminal open. Now, you are ready to rock! 9. You will be prompted to `Enter new UNIX username` (this will create a local user account for the **Ubuntu WSL instance** and you will be automatically logged in to your Ubuntu distro as this user). You can use any combination of alphanumeric characters for your username, but a good choice is `` (e.g., `jsmith` for John Smith). You will then be prompted to enter a new password - (choose something easy to remember as you will use it frequently for this course). + (**store this password in a safe place, you will need to use it during the course**). From this point on, whenever the instructions specify to **"open/type a command -in a terminal"**, please open/type the command in the +in a terminal"**, please do so using the Ubuntu application (open **Start (Win key)**, search for **Ubuntu**, and click **Ubuntu** or **Ubuntu \**). +Do not use Command Prompt or Powershell for the remaining steps unless explicitly stated. Need more help? @@ -79,9 +80,11 @@ You already have it, now that you’ve installed the WSL2! {% include extra-git-setup.html %} -#### Creating an SSH key for GitHub +#### Create an SSH key for GitHub -When following the GitHub docs below, make sure to select the **Linux** instructions. +> **Important**: When following the GitHub docs in the steps below, make sure to: +> - Select the **Linux** instructions at the top of the page +> - Run all commands in your Ubuntu terminal {% include gh-ssh-key-setup.html %} @@ -89,9 +92,7 @@ When following the GitHub docs below, make sure to select the **Linux** instruct 1. Go to [this page](https://code.visualstudio.com/) and click the download button, then run the `.exe` file. -2. Leave all the defaults during the installation with the following exception: - - Make sure the box labeled "Register Code as an editor for supported - file types" is selected +2. Leave all the defaults during the installation, but make sure that "Register Code as an editor for supported file types" is selected. #### VSCode extensions @@ -99,40 +100,44 @@ These extensions will allow you to work with WSL2 Ubuntu more seamlessly in VSCo 1. Open Visual Studio Code, click on the **Extensions** icon in the left sidebar (or press `Ctrl+Shift+X`), and search for and install the **WSL** extension - (usually, VSCode can automatically detect your WSL Ubuntu installation and remind you to install related extensions). -1. In a **terminal** (Ubuntu), type `code .` and press `Enter`. - You should see a message reading `Installing VS Code Server` and then a new VSCode window - (might be called `Get Started - [WSL: Ubuntu ] Visual Studio Code`) will open up. - It should say `WSL` in the bottom left corner of the window. -1. In the **WSL VSCode window**, open the **Extensions** panel again (or `Ctrl+Shift+X`). + (usually, VSCode can automatically detect your WSL Ubuntu installation and prompt you to install related extensions in the bottom right corner). +2. In a **terminal** (Ubuntu), type `code .` and press `Enter`. + You should see a message reading `Installing VS Code Server`, and then a new VSCode window will open up. + The bottom left corner of the window should read `WSL`. + +{% include vs-code-workspace-trust-popup.html %} + +3. In the new **WSL VSCode window**, open the **Extensions** panel again (or `Ctrl+Shift+X`). Search for each of the following extensions and click `Install` - (or `Install in WSL: Ubuntu`, depending on whether you already have the extension installed locally) for the first entry that appears. + (or `Install in WSL: Ubuntu`, if you already have the extension installed locally) for the first entry that appears. If no `Install` button is available and the extension is not grayed out, it means it is already installed. {% include vs-code-extensions.html %} -To confirm the extensions have been installed correctly, clear the Extensions search bar. +To confirm the extensions have been installed correctly, clear the **Extensions** search bar. You should now see an extensions category called `WSL: UBUNTU - INSTALLED` (you may also see one for `LOCAL - INSTALLED`). -Verify that the extensions you have just installed exist in the list under `WSL: UBUNTU - INSTALLED`. +Verify that the extensions you have just installed appear in the list under `WSL: UBUNTU - INSTALLED`. #### WSL2 Ubuntu terminal in VSCode -You can open the terminal in your **WSL VSCode window** (if you do not already have -one at the bottom of the window) by navigating to **View > Terminal** in -the top menu bar (or, `` Ctrl+` ``). This terminal in a WSL VSCode window -is equivalent to the WSL2 Ubuntu terminal we get from opening the Ubuntu app -itself (i.e., like we did from the **Start (Win key)** menu), but with the -advantage of having all the graphical features of VSCode at your disposal. +To open the terminal in your **WSL VSCode window** (if you do not already see +one at the bottom of the window), navigate to **View > Terminal** in +the top menu bar (or `` Ctrl+` ``). +This terminal in a WSL VSCode window is equivalent to the WSL2 Ubuntu terminal we get from opening the Ubuntu app itself +(e.g., from the **Start (Win key)** menu), +but with the advantage of having all the graphical features of VSCode at your disposal. Reference: [https://code.visualstudio.com/docs/remote/wsl](https://code.visualstudio.com/docs/remote/wsl) +{% include copilot-setup.html %} + ### Python (in the WSL2 Ubuntu) -We are going to install miniconda to manage the Python environment in our WSL2 -Ubuntu using the **VSCode terminal** (alternatively, you can use the WSL Ubuntu -terminal directly: open **Start (Win key)** and search for the **Ubuntu** app). +We will now install miniconda to manage the Python environment in our WSL2 +Ubuntu using the **WSL VSCode terminal** (you can also use the WSL2 Ubuntu +terminal directly). 1. Type the following lines (separately) into the terminal and press `Enter` after each one: @@ -144,19 +149,18 @@ terminal directly: open **Start (Win key)** and search for the **Ubuntu** app). 2. A license agreement will be displayed and the bottom of the terminal will read `--More--`. Press `Enter` or the space bar until you are prompted with - `Do you accept the license terms? [yes\|no].` + `Do you accept the license terms? [yes|no].` Type `yes` and then press `Enter`. -3. The installation script will inform you that it is going to install into a - default directory (e.g., `/home/$USER/miniconda3`). +3. The installer will show a default installation directory (e.g., `/home/$USER/miniconda3`). Leave this default and press `Enter`. -4. When you are asked "Do you wish the installer to initialize Miniconda3 by - running conda init? [yes\|no]," type `yes` and press `Enter`. - Close the terminal once the installation has finished. -5. Re-open the Ubuntu terminal. Type `which python` into the terminal and it - should return a path (e.g., `/home/$USER/miniconda3/bin/python`). - - If you do not see a path like this then please try `cd miniconda3/bin/` - then `./conda init`, close (or re-open) your terminal, and repeat this step. - If your issue is still not resolved skip the following step and +4. When you are asked `Do you wish the installer to initialize Miniconda3 by + running conda init? [yes|no]`, type `yes` and press `Enter`. + Close the terminal once the installation has finished (you can do this by typing `exit`). +5. Re-open the Ubuntu terminal. + Type `which python` and check that it returns a path like: `/home/$USER/miniconda3/bin/python`. + - If you do not see a path like this, try `cd miniconda3/bin/` + then `./conda init`, close and re-open your terminal, then repeat this step. + If your issue is still not resolved, skip the following step and contact an instructor on the `#help-installation` channel on the Slack workspace. 6. Type the following to remove the installation script that was downloaded: @@ -168,49 +172,60 @@ terminal directly: open **Start (Win key)** and search for the **Ubuntu** app). {% include setup-python-package.html %} -Now you are ready to use VSCode to edit your Python script or Jupyter -Notebook in your WSL2 Ubuntu distribution. +You can now use VSCode to edit a Python script or Jupyter Notebook in your WSL2 Ubuntu distribution. #### Reminders: -- You may need to reactivate the `qlsc612` environment each time you start the - WSL2 (e.g., in VSCode) with `conda activate qlsc612`. -- When running a Jupyter notebook in VSCode (remote access to your WSL2 Ubuntu) - you will also need to specify the Python environment (kernel). - There will be a `Select Kernel` button in the top right corner of the Jupyter notebook, - click it and select the one reading something like _qlsc612 - (Python 3.x.y) ~/miniconda3/envs/qlsc612/bin/python_. - The button should be updated to read _qlsc612 (Python 3.x.y)_. - This is the Python environment we have just created for this course, - make sure it is the one you are using for later modules. +- Each time you launch the WSL2 Ubuntu, you may need to reactivate the `qlsc612` environment for the terminal with `conda activate qlsc612`. +- When running a Jupyter notebook in VSCode (remote access to your WSL2 Ubuntu), + you will also need to specify the Python environment for the notebook (kernel). + This will be demonstrated in class, but as a reference: + - There will be a `Select Kernel` button in the top right corner of the Jupyter notebook window. + Click this button and select the option that looks like _qlsc612 + (Python 3.x.y) ~/miniconda3/envs/qlsc612/bin/python_. + - The button should now be updated to read _qlsc612 (Python 3.x.y)_. + This is the Python environment we have just created for this course. ### Docker Desktop for Windows -You should install Docker Desktop after you have successfully installed WSL2. +Only install Docker Desktop after you have successfully installed WSL2. 1. Go to [this page](https://docs.docker.com/desktop/install/windows-install/) and click "Docker Desktop for Windows", then run the downloaded installer. -2. When prompted, ensure the "Use WSL 2 instead of Hyper-V option" on the +2. When prompted, ensure the "Use WSL 2 instead of Hyper-V" on the Configuration page is selected. -3. Follow the instructions on the installation wizard to authorize the installer - and proceed with the install. -4. When the installation is successful, click "Close" to complete the - installation process. (If the admin account on your computer is different to your user account, you must add the user to the docker-users group. Run **Computer +3. Follow the instructions in the installation wizard to authorize the installer + and proceed with the installation. +4. Once the installation is successful, click "Close" to complete the + installation process. + - NOTE: If the admin account on your computer is different from your user account, you must add the user to the docker-users group. Run **Computer Management** as an administrator and navigate to Local Users and Groups > Groups > docker-users. Right-click to add the user to the group. Log out and - log back in for the changes to take effect.) + log back in for the changes to take effect. 5. Open **Start (Win key)**, search for **Docker Desktop** in your applications, and click to run the app. Once Docker Desktop has loaded, in a **WSL2 Ubuntu terminal** (in VSCode or your Ubuntu app), type `docker run hello-world`. - A brief introductory message should be printed to the screen. + If the installation worked, a brief introductory message should be printed to the screen. #### Reminders: - Whenever you need to use Docker, first make sure that Docker Desktop is running (open **Start (Win key)** and search for the **Docker Desktop** app) -- For this course, you should run Docker commands from a **WSL2 Ubuntu terminal**. - However, in general you can also use Docker command-line tools in Command Prompt or PowerShell. +- For this course, you should always run Docker commands from a **WSL2 Ubuntu terminal**. + However, in general, you can also use Docker command-line tools in Command Prompt or PowerShell. + +The above step-by-step instructions are distilled from [https://docs.docker.com/desktop/setup/install/windows-install/](https://docs.docker.com/desktop/setup/install/windows-install/). + +### Install the `tree` command + +`tree` is a helpful command for viewing directory structures, and is strongly recommended. -The above step-by-step instructions are distilled from -[here](https://docs.docker.com/desktop/setup/install/windows-install/). +1. Open a terminal (Ubuntu), and check if you have `tree` already installed by running `tree --version`. + - If you see a version number, you're all set! + - If you see a message like `tree: command not found`, install it by running: + ```bash + sudo apt-get update && sudo apt-get install -y tree + ``` + You may be prompted to enter your password to proceed. + If so, use the password for the WSL Ubuntu account you created during the WSL2 setup. ---