Making with Code

Initial setup #

These instructions will help you get your computer set up for the class. If you get stuck or are unsure what to do, you can contact us.


Visual Studio Code #

This is the editor that you will use to write your code.

(0) Download and Install. Open this link, click “Download Mac Universal,” or use the dropdown to select your operating system. Follow the installation instructions.

(1) Drag to Applications Folder. Open up the Finder application on your Mac. On the left hand side, click on Downloads. Drag it to the folder named Applications.

(2) Install Shell Commands. Open up your freshly installed Visual Studio Code application. From the top menu, select View > Command Pallete.

In the prompt, type Shell Commands and click on the first option to install the code command in your PATH.


Opening the Terminal #

For most of the remaining setup, you will be using your Terminal. This is an application that lets you type commands directly to your computer. You can access it through any of these ways:

  • Using your 🔍 spotlight search (press +space then type “terminal”)

  • Or, you can find it using your computer’s launchpad

One you have it open, it should look something like this:


Installing Xcode #

💻 Copy and paste the command below into your Terminal to install Xcode. Then press Enter/Return. Make sure you have a strong internet connection, this may take up to 2 hours to complete. Don’t worry, you can still use your computer and have it running in the background.

xcode-select --install

💻 Enter your password when prompted. You won’t see any letters appearing as you enter the password. This is a security feature.

👾 💬

If you already have this installed, you will see the following message instead:

xcode-select: error: command line tools are already installed, use "Software Update" to install updates


Installing Python #

Python is the language we will be coding in

(0) Start by installing the latest version of Python. Open this link, click “Download Python,” and follow the installation instructions.

(1) Once the installation finishes, you will see a Finder window showing what was installed. (If you closed the window, open Finder, click on “Applications,” and then “Python 3.11” (or whatever version of Python you just installed).

(2) Check Python installed successfully by typing python --version into the Terminal. You should see a version number above 3.11.

(3) Double-click on “Install Certificates.command”. This will will open a Terminal window and run a bunch of commands. Once you see [Process completed], you may close the window.

(4) Double-click on “Update Shell Profile.command”. Each of these will open a Terminal window and run a bunch of commands. Once you see [Process completed], you may close the window.

Here is a video that walks you through the steps.

👾 💬

If you see a red “Permission denied” error message when running “Install Certificates.command”:

  • open a Terminal window and run sudo "/Applications/Python 3.11/Install Certificates.command"
  • You will be asked for an administrator password; you won’t see any letters appearing as you enter the password. This is a security feature.


Installing Homebrew #

Homebrew helps you install different libraries and packages

💻 Run the below command to install homebrew. This will install homebrew onto your computer. This may take up to an hour to complete. Don’t worry, you can still use your computer and have it running in the background. If you already have homebrew, then this step will be quick.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

💻 As the installation runs, follow all the instructions, such as:

  • type your password - you won’t see any letters appearing as you enter the password. This is a security feature.
  • press Enter to continue
  • copy/paste certain commands

It may ask you to press Enter a few more times throughout the process.

You will know it is finished when you see your username and a $ once again. For example:*

bgenzlinger~/Documents$

Installing Poetry #

Poetry makes sure your coding environment is set up to work for all your coding projects

💻 Run the below command to install Poetry

curl -sSL https://install.python-poetry.org | python3 -

Testing your Setup #

💻 Run each of the following checks one at a time to check your setup. You should see a version number appear after each command.

code -v
xcode-select --install
python3 --version
brew -v
poetry --version

Directories #

Our labs assume students have the following directory setup:

Desktop 
└── making_with_code
    ├── cs9
        └── unit00
        └── unit01
        └── unit02
    └── cs10
        └── unit00
            └── unit01
            └── unit02

You can of course change this, you will just need to change the path in the set up instructions for each lab.


General Tips #

Customize visual look fo the Terminal and VSCode. Encourage students to help themselves read it as much as possible.