Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Task 08 - Install Python

Introduction

Python is a versatile, high-level programming language known for its readability and ease of use. It supports multiple programming paradigms, including procedural, object-oriented, and functional programming. Python is widely used in various fields such as web development, data science, artificial intelligence, automation, and more. The legacy Contoso Hotel app that you’ll deploy uses Python code.

Description

In this task, you’ll ensure that Python is installed and install Python if needed.

The key steps are as follows:

  1. Run a command to determine whether Python is installed.
  2. Install Python if necessary.
  3. Verify that Python is correctly installed.

Success Criteria

  • You’ve successfully installed Python.

Learning Resources

Solution

Expand this section to view the solution
  1. Enter the following command at the Visual Studio Terminal window prompt and then select Enter. This command returns the Python version if Python is installed.

     python --version
    

    nvp4l2p8.png

    If Python version 3.10 to 3.12 is installed, skip the remaining steps in this task and move on to the next task. If Python is not installed, complete the following steps to install Python. If Python version 3.13 is installed, uninstall Python and then complete the following steps to install Python.

  2. Open a web browser and go to Download the latest version for Windows.

    m7y9ictq.png

  3. Scroll down to the Looking for a specific release section and then locate version 3.12.7. Select the Download link for version 3.12.7.

    Version 3.13 does not support the Prompt Flow tools that the lab requires. You must use Python version 3.10, 3.11, or 3.12 for this lab.

  4. When the download completes, select Open file.

    xscx7ua3.png

  5. In the Python Setup dialog, select Install Now.

    gaojc236.png

  6. If a User Account Control dialog displays, select Yes. Wait while Python installs.

    ni2snffz.png

  7. In the Python Setup dialog, select Close.

    792sy8vq.png

  8. Return to Visual Studio Code. Enter the following command at the Terminal window prompt and then select Enter. Verify that the command returns the Python version.

     python --version
    
  9. Leave Visual Studio Code open. You’ll use the tool again in the next task.