ICS 32A Fall 2023
Project 0B: Square One
Installation and Configuration on Windows


Introduction

This document explains how to install the ICS 32A development environment on a machine running the Windows operating system. You'll need to be sure you pay attention to small details as you follow through them.


Step 1: Show file name extensions

The first step is not to install a software package at all, but to reconfigure a Windows default that is fine for everyday users, but very troublesome for those of us who write programs or do other serious work. By default, when Windows displays a list of filenames (e.g., in File Explorer, Windows Explorer, or on the desktop), it hides the "file name extension" (i.e., the part of the filename that follows the last dot), so that a file named alex.txt will simply have its name displayed as alex instead, with an icon used to visually differentiate one "type" of file from another.

This default is fine for casual users, but is certain to cause us problems in this course — and routinely causes my students problems in courses where there is programming involved — so everyone needs to turn this off, which is easy to do:

Seriously! Do this! You'll be very glad you did; as a programmer, filenames and their extensions are often relevant to the work you're doing, so it's important to see filenames as they are.


Step 2: Downloading and installing Python

If you've taken previous coursework in Python, you may already have a version of Python installed on your machine, but it will be important that you use the right version in this course. As of this writing, the latest release of Python 3.11 is Python 3.11.5 64-bit for Windows, which is available at the following link.

(Note, too, that the Microsoft Store has a version of Python available, but you'll generally want to avoid this installation and stick with the one available from python.org linked above.)

Before you run this, it's not a bad idea to uninstall any other version you already have installed. While different versions of Python can safely coexist on a system in some cases, they do cause some confusion, so if you don't have a specific reason to maintain multiple versions, it's easiest to keep just one. You can uninstall Python just as you would any other Windows application (e.g., Add/Remove Programs, Programs and Features, etc., depending on your Windows version).

When you run this, there are a few settings worth tweaking in the installer's defaults.

The installation will proceed from there and will probably take a little time to run. When you're done, you can feel free to delete the Python installer you downloaded; you won't need it again.


Step 3: Configuring your Python installation

Starting a Command Prompt

Many of you may never have used a Command Prompt in Windows before, but we will have a need for it in this course. Whenever I specify that you should start a Command Prompt on any version of Windows, you can most easily do this by holding down the Windows key and pressing R, which will pop up a dialog asking you what you would like to run. Type cmd into the text field and click OK. (You can also create shortcuts, find it in your Start Menu, or pin it to your taskbar, but cmd will work if you have no other way to do it.)

Understanding the PATH environment variable

A Command Prompt offers a way to navigate the folders on your storage devices (such as your hard drive(s)) manually and run programs and other commands by typing their names. For example, there is a command-line version of the Python shell; the program is called python.exe, and you can execute it by simply typing its name (and the .exe is not necessary, so you can just type python). Try that now, and, if it works, you'll see this appear in the Command Prompt window.


Python 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>>

If so, type quit() and press Enter to stop the Python shell, then close the Command Prompt window; you're good to go and are ready to try launching IDLE, which we'll be mainly using for our work this quarter.

If you see a different version — don't worry too much about the date or the funny-looking "cce6ba9" numbering; as long as you see "3.11.5", you're where you need to be — that means you have another version of Python installed and its folder appears earlier in your PATH environment variable than the new one does. If instead you see an error message like this (note that it varies a bit from one version of Windows to another):


'python' is not recognized as an internal or external command,
operable program or batch file.

then the likeliest cause is that you didn't ask Python's installer to configure your PATH environment variable correctly. Your easiest solution to that problem is to uninstall it, then re-install it by following the instructions above.

Starting IDLE

Lastly, you'll want to be sure that you try starting IDLE and verify that it, too, is running the right version of Python. The easiest way to launch IDLE is to find it in your Start Menu — there should be a program group called Python 3.11, in which you'll find a link called IDLE (Python GUI). Click that link; you should see a window pop up, in which will appear the same message you saw when you started Python from the Command Prompt:


Python 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>>

If so, you're ready to roll!


Congratulations!

Nice work! You should now be ready to proceed with your Python-based work this quarter. We will likely need additional tools later in the quarter, but this will be sufficient to get started.