Getting your computer ready for CS 251/252

Follow the tasks below to install free software on your computer that you will need for CS 251/252:

  1. Python
  2. Microsoft VS Code
  3. Python modules for data science and machine learning
  4. Set up your computer to show full file names
  5. Zoom (optional)

You will find step-by-step instructions below to get up and running, whether you have a Mac or Windows PC.



Tasks

L1. Python

In this class, we are using the Python 3.9 programming language. It is important that you follow these directions to make sure that everyone has the right version installed. Here are instructions for both Mac and Windows users.

L1a. Install Python (macOS)

  1. Download Python 3.9 from python.org.
  2. Open the downloaded file called python-3.9.1-macos11.0.pkg (you might not see the .pkg part and that's ok). The file should be in your Downloads folder.
  3. Click the Continue buttons several times.

  4. You should now need to enter your password and Python will install (might take a minute).
  5. At the end of the installation, you might see a Python 3.9 folder pop up. If you do not see this, open the folder yourself (/Applications/Python 3.9). Double click the Install Certificates.command file to run the certificate installation.

  6. Now check to make sure it installed correctly. Open Terminal (you can find the app by going to the Applications/Utilities folder in Finder or by searching for it using Spotlight (press Cmd+spacebar, type Terminal, then press Enter)).
  7. Type python3 --version and hit Enter. It should return Python 3.9.1, which means it worked!

L1b. Install Python (Windows)

  1. Download Python 3.9 (x86-64) from python.org then and run the installer file called python-3.9.1-amd64.exe.
  2. When the installation window pops up, check last box: "Add Python 3.9 to PATH".

  3. Click "Install Now" at the top.
  4. Press WinKey+R to open the Run box.
  5. Type cmd then press Enter.
  6. Type py --version, then press Enter. It should print Python 3.9.1, which means it worked!

L2. Microsoft Visual Studio Code

I recommend using the same text editor to write your code for labs and projects as many CS profs use in class, which is called Microsoft Visual Studio Code (VS Code for short). Here are instructions how to install it for Mac and Windows PC users.

L2a. Install VS Code (macOS)

  1. Download Microsoft VS Code.
  2. You should see a file with a blue icon called Visual Studio Code in your Downloads folder. Drag it into your Applications folder:

  3. Open VS Code and create a new file (e.g. press Cmd+N followed by Cmd+S, navigate to your Desktop, then name the new file test.py). You should see a pop-up asking you about installing a Python extension. Click Install:

  4. VS Code should install it, then you should see a screen like the following. On the lower-left, click the text that says "Python", followed by some numbers:

  5. A drop-down menu should appear with some options at the top. Click the entry that says Python 3.9.1 64 bit followed by /usr/local/bin/python3:

  6. Finally, you should dismiss a pop-up window that continually appears about "Linter pylint". Click Do not show again. You should now be all ready to write Python code in VS Code!

L2b. Install VS Code (Windows)

  1. Download Microsoft VS Code and double-click the installer file to install it on your computer.
  2. Now let's integrate Python with your code editor VS Code. Open VS Code and create a new file (Press Control+N followed by Control+S. Navigate to your Desktop. Save the file as test.py).
  3. You should now see a pop-up in VS Code about a Python extension being recommended. Click Install.

  4. You should now see "Python 3.9.1" in the bottom left corner of the editor, which means you are all ready to go!


L3. Data science / machine learning Python modules

You will need a standard set of data science / machine learning Python libraries installed for this class.

L3a. Installing the modules

Enter the following command in Terminal:

pip3 install numpy scipy pandas palettable Pillow matplotlib seaborn jupyter scikit-learn

L3b. Opening a Jupyter notebook

Week 2+

After installing Jupyter notebook, the following steps summarize how to open and update a notebook file (.ipynb file extension).

  1. Open Terminal
  2. Change directory to your project folder (e.g. with cd).
  3. Enter the command:
    jupyter notebook
    A browser window should pop up with a file browsing interface of the current working directory in Terminal.
  4. Open a notebook file (or create a new one).
  5. Execute cells with Shift+Enter. Make sure the notebook says "Trusted" on the top-right. If the notebook is not trust, click the Not Trusted button, then confirm that the notebook is safe.
  6. Manually save frequently with Cmd+S
  7. To close down all Jupyter notebooks from running, go to browser tab that shows you files in your working directory and click Quit on the top-right corner.


L4. Show file extensions

To make sure that you can visually recognize code files, let's make sure that you can see file extensions (like .docx for MS Word files) on your computer.

L4a. Show file extensions (macOS)

  1. Go to Finder preferences by click on your desktop background, click Finder on top left corner of the screen then click Preferences....
  2. Click Advanced.
  3. Make sure Show all filename extensions is checked.

L4b. Show file extensions (Windows)

  1. Open up Windows Explorer (e.g. Press Control+N after clicking on your Desktop background).
  2. Go to Folder Options:

  3. Click on the View tab and make sure that Hide extensions for known file types is unchecked.

L5. Zoom (optional)

You should install the Zoom app on your computer in case we need to "go remote" this semester.

Download Zoom to your computer and install it (you want "Zoom Client for Meetings").


© 2021 Oliver Layton