Installing Python

For the latter part of this course, we will be building more complex programs than can't be written in Python Notebooks. For this reason, you will need to have a Python interpreter and a source-code editor installed on your computer. Fortunately, both of these things are available for free and can be installed relatively easily.

For this course, we recommend using the Python interpreter available from python.org and Visual Studio Code as a source-code editor. However, if you have gotten a Python interpreter from somewhere else, or a have different source-code editor you prefer, you can use them if you wish. We encourage you to do whatever you are comfortable with.

Overview

These instructions describe generally what needs to be done to install Python and Visual Studio Code. In most cases, we expect them to work as is, but it always possible that there is something particular about your computer that causes them not to work properly. If you have any problems you can post a comment below or talk to your tutor during your lab.

Windows

  1. Download Python 3.9.7 from python.org . If you hover over the 'Download' button in the menu, it should give you a button to download the right version of Python for your operating system.

  2. Once the download has finished, double click the file to install Python. Follow the prompts to install the software, but make sure to:

    • Tick the box Add Python 3.9 to PATH at the start of installation
    • Click the button Disable path length limit after installation.
  3. Download Visual Studio Code from its website. The main button on the page should download the right version for your computer.

  4. Once downloaded, install it. Make sure the following boxes are ticked during installation.

    • Add "Open with Code" action to Windows Explorer file context menu
    • Add "Open with Code" action to Windows Explorer directory context menu
    • Register Code as an editor for supported file types
    • Add to PATH (requires shell restart)
  5. Download a file containing all the course material so far from here. It's a zip file containing a folder called cs1010-21t3-main . Copy or extract this folder to wherever you keep your coursework.

  6. Right click on the folder itself and click "Open with Code". It's important to do it this way as Visual Studio Code needs to be aware of the entire contents of the folder.

  7. Click on resources-and-references -> python-setup and setup.ipynb on the left-hand section of the window. You will be asked to install the recommended extensions. Click Install and wait until a tab titled Python - Getting Started opens. This may take a little while.

  8. Close all open tabs and go back to the Explorer view by clicking View in the top menu then Explorer . Click on setup.ipynb again and click Trust all notebooks . Tick the box below Jupyter: Always Trust Notebooks .

  9. Close all open tabs and click on setup.ipynb again . This opens it as a trusted notebook. Follow the instructions in the notebook itself to finish the installation.

Mac

  1. Download Python 3.9.7 from python.org . If you hover over the 'Download' button in the menu, it should give you a button to download the right version of Python for your operating system.
  2. Double click on the file and follow the prompts to install it. After installing, double click on Update Shell Profile.command and Install Certificates.command to configure it for use.
  3. Download Visual Studio Code and copy it to the Applications folder.
  4. Download a file containing all the course material so far from here. It's a zip file containing a folder called cs1010-21t3-main . Copy or extract this folder to wherever you keep your coursework.
  5. Open the Visual Studio Code application and use File -> Open to open the cs1010-21t3-main folder.
  6. Click on resources-and-references -> python-setup and setup.ipynb on the left-hand section of the window. You will be asked to install the recommended extensions. Click Install and wait until a tab titled Python - Getting Started opens. This may take a little while.
  7. You may be prompted to install the Xcode command line tools. If so, install them. You may find them useful later on in the course.
  8. Close all open tabs and go back to the Explorer view by clicking View in the top menu then Explorer . Click on setup.ipynb again and click Trust all notebooks . Tick the box below Jupyter: Always Trust Notebooks .
  9. Close all open tabs and click on setup.ipynb again . This opens it as a trusted notebook.
  10. You may be asked to install Jupyter. If so, click Install and wait for it to finish installing. If asked to select the python version, make sure to pick Python 3.9.7 . Follow the instructions in the notebook itself to finish the installation.