This guide will walk you through installing the software you’ll need for the course. Before diving in it’s worth understanding what you’re about to do at a high level.
First, you should be sure your operating system is up-to-date. If you did not already move through the Operating System Update steps, then go ahead and do that.
Next, you’ll install the software needed to write your own programs in the course. In general, to write your own programs you need two kinds of software installed: a programming language toolkit and a text editor designed for programming. For this course we’ll explore programming with the Python programming language using the Visual Studio Code text editor. These are two of the most widely used tools of their kind in 2021 and are highly applicable beyond the scope of this course.
Finally, you’ll install the Zoom Web Conferencing software. Installing this app on your computer, rather than using the web version, will improve your experience and make it easier for you to share your screen with our course staff as needed. If you already have the app installed, be sure to check for updates as Zoom improved over the break.
Follow the instructions for your operating system, either Windows 10 and 11 or macOS.
Windows 10 and 11 Instructions
Before beginning, be sure you are using the latest version of Windows 10.
0. Install the Latest (Release Candidate) Python Programming Language Toolkit (3.11.1 or greater)
For these steps, be sure your web browser Window is maximized and be sure to follow step 4.0 closely that checks the option “Add Python 3.11.1 to Path” during install.
- Open the Python Website in another tab: https://www.python.org
- Press the Downloads button in navigation.
- In the headline, you should see “Download the latest version for Windows”.
- If, instead, you see “Download the latest version of Python” be sure your browser Window is maximized and refresh the web page.
- Press the Download Python 3.11.4 button. The download should begin.
- If you are taken to another page without a download beginning, scroll down to the Files heading and select the file named
Windows x86 executable installer
.**
- If you are taken to another page without a download beginning, scroll down to the Files heading and select the file named
- Open the download once it completes and carefully follow the instructions below, especially the first one:
- IMPORTANT: Check the box on the first screen labelled “Add Python 3.11.4 to PATH”
- If you do not see this option, you likely have an older version of Python already installed. Go ahead and uninstall the old version and then retry installing the new version.
- Knowing exactly what this does is beyond your concern, but the gist is it makes it easier for other programs on your system to make use of Python.
- After checking the box of Step 0, click Install Now.
- Allow the installer to make changes if further prompted.
- Accept other defaults on following screens.
- Click the Close button to complete the Install.
- IMPORTANT: Check the box on the first screen labelled “Add Python 3.11.4 to PATH”
1. Install the Visual Studio Code (VSCode) Text Editor
- Open the VSCode website in another tab: https://code.visualstudio.com/
- Select the large Download for Windows button
- Open the downloaded installer after its download completes
- Accept the licensing agreement
- You’re asked where to install VS Code. The suggested location is OK. Press Next.
- You’re asked if you want to add VS Code to your start menu. That’s OK, too. Press Next.
- Important Under additional tasks, check all of the options available.
- These options make it easier for you to open files in VS Code.
- At Ready to Install, select Install.
2. Install the git
Source Code Management Software (SCM)
- Open the
git
website in another tab: https://git-scm.com - Look for the button to “Download for Windows” (it is embedded in a monitor graphic to the right)
- After the download begins open the installer
- Allow the app to make changes and install
- Press Next on the Information page
- Press Next on the Destination Location page (default is fine)
- Press Next on the Components page (defaults are fine)
- Press Next on the Start Menu Folder page
- Choose Visual Studio Code as Git’s default editor and press Next
- Press Next/Install on the remaining pages and accept the defaults
3. Reboot your machine!
Reboot your computer now. Some settings of the applications you just installed will not take effect until you reboot. Attempting to continue on from this point without rebooting will lead to strange errors later.
Once you’ve completed this, you’ve got the necessary software installed! Great work!
macOS Instructions
Before beginning, be sure you are using the latest version of macOS.
0. Update Your Default Shell in the Terminal
There are two pieces of jargon in the title of this section. A “shell” is a program that serves as a concierge to your computer: you give it commands, such as asking it to run a program you’re working on, and the shell does the work of carrying out your command. A “terminal” is the program you will use to interact with your shell. Apple recently updated its recommended shell software to Z-shell, or zsh
, so let’s be sure yours is configured to use it.
- Using Mac’s Spotlight Search, accessed by pressing
Command + Spacebar
or clicking the search icon near your clock, typeTerminal
and press enter. This starts the Terminal app, which may look like what hackers use in the movies, because it is. - Let’s learn what shell program your terminal is using by default by typing the following (cryptic, based on what we know now) command and pressing enter:
echo $SHELL
(yes, that’s the wordecho
, followed by a space, and then a dollar sign followed immediately by the word SHELL in all capital letters,$SHELL
) - If you see
/bin/bash
in the text “printed” below your command, continue to next step to update your default. If, instead, you see/bin/zsh
, you are all set and can jump to step 6. - Since you saw
bash
instead ofzsh
, let’sch
ange your defaultsh
ell using thechsh
program to be the location, or path, of thezsh
shell program on your computer which is/bin/zsh
. Type the following command, check that yours matches exactly, in both spaces and capitalization, and press enter:chsh -s /bin/zsh
- You will likely be asked for your computer’s password. When you type in your password you will not see any text appear on your screen, not even dots, but the keys you type are being received. Press enter once you’ve entered your password. If you see “Credentials could not be verified, username or password is invalid.” try running the command again and entering your laptop’s password again.
- This change will be applied to your next shell session, so type
exit
, close yourTerminal
again. Go back up to step 0, and continue from there, to confirm it was successful. - Great! You can quit your shell session by typing
exit
, pressing enter, and then closing yourTerminal
window.
1. Install (or Update) the Python Programming Language Toolkit (3.11.1 or greater)
For these steps, be sure your Web Browser window is maximized.
- Open the Python Website in a new tab: https://www.python.org
- Select the Downloads button in the navigation
- Look for the “Download latest version for Mac OS X”
- If you instead see, “Download the latest version of Python”, make sure your browser is full screen and refresh the page.
- Click the Download Python 3.11.4 button. Your download should begin.
- If you are brought to another page, scroll down to the Files section and select the
macOS 64-bit universal2 installer
.
- If you are brought to another page, scroll down to the Files section and select the
- Open the downloaded package to begin the installer
- At Introduction screen: Continue
- At the Read Me screen: Continue
- At the License: Continue (Agree)
- At Installation Type: Install
- After Install completes, select Close and close any windows it popped up.
- If asked, move the installer to Trash
2. Configure your Shell to use the Latest Python
- Open a new Terminal window. If you still have one open from section 0, close it out and start a new one, because changes made during the installation of Python will not take effect until a new shell session begins.
- Give the command
python3 --version
, notice the3
after the wordpython
and two dashes at the front of--version
, and press enter. You should seePython 3.11.1
(or greater) which indicates your install was successful. If not, try the steps above one more time and restart your computer before trying these. Otherwise, come work with us in office hours! - Now try giving the command
python --version
, without the3
from above. If you seePython 2.X.YY
, whereX
andYY
are irrelevant numbers, continue to the next step because Mac also includes a much older version of Python. This is confusing when you’re trying to learn modern Python! If you seePython 3.X.YY
, but notPython 3.11.1
or greater, this means you previously installed an older version of Python3, and you should also continue to step 3. If you see the resultPython 3.11.x
then you are all set and can continue to the next section on installing VSCode. - Let’s simplify life by making
python
refer to the latest version you just installed, not the old one. What the following command is doing is making a link between the namepython
and the version you just installed. The command is more advanced than where we are at, so do not worry yourself on its details. You should copy and paste the following command into your Terminal, and press enter, because the punctuation symbols need to match precisely.
sudo ln -s "$(which python3)" "$(dirname $(which python3))/python"
If you are prompted for a password, enter your computer’s password. You will not see any indication of your keystrokes show up as you type in your password, but they are being recorded. Press enter after typing your password invisibly. 4. 4. This change will only take place in a new shell session. Type the exit
command, press enter, close your terminal. Go back to Step 0 and continue on until confirming python --version
is successfully linked to Python 3.11.1
or greater.
3. Install the Visual Studio Code (VSCode) Text Editor
- Open the VSCode website in a new browser tab: https://code.visualstudio.com/
- Select the large Download for Mac button
- When you open this Zip download, it creates an application file named Visual Studio Code in your Downloads folder and opens that folder in a new Finder window.
- Confirm your Finder window sidebar is visible, it should be to the left of your files and you should see Applications listed under Favorites. If you do not see the sidebar, go to the View menu and select Show Sidebar. If you do not see Applications listed under Favorites, open the Finder menu, select Preferences…, and check Applications.
- To install Visual Studio Code as an Application, drag the Visual Studio Code icon into your Applications directory which you should see in the left-hand sidebar of the Finder window under Favorites.
- Open Spotlight Search again (
Command + Space
or the search icon by your clock) and search for “Code”. You should see Visual Studio Code in the results. Open it and it will likely ask to confirm it’s OK to open a file downloaded off the internet. Accept. - You should see Visual Studio Code open to a Welcome tab. If you do, you’re all set and can close it for now and continue on.
4. Install the git
Source Code Management Software (SCM)
- If you do not have a running shell session in Terminal, start one as you did above.
- Type
git --version
and press Enter. - If you see text displayed such as “git version 2.21.0)” then you already have
git
installed and can close the terminal and continue on - If
git
was not already installed, you should see a pop-up window asking you to install Git / Developer Tools. Accept this install request and follow its instructions through completion. After it completes,exit
and continue to Step 0 to confirm the install succeeded.- Note: You may instead see a notice about accepting a license agreement and/or running a given command in your terminal. In that case, just follow the instructions and enter your password if needed.
Once you’ve completed this, you’ve got the necessary software installed! Great work!
Basic Troubleshooting
If you are having trouble linking to your newest version of python, try these things…
Remember that you can always check which version of python is being run by typing python --version
in your terminal.
Deactivate Conda
Many people seem to have issues because they have previously installed Conda. Therefore the python
and/or python3
commands could be calling this version. If this is your case, open your terminal and type:
conda deactivate
Don’t worry! You will be able to reactivate it again if you need it!
Unalias python
It might be the case that there is an existing Python alias on your computer. Open your terminal and type:
unalias python
If nothing is output, that means that an old alias existed and you just deleted it. If you get an error code, then this was not the issue.
Restart your Terminal
It could just be an issue of closing out of your terminal and opening it back up!