Installing Python

Note

Before starting the Python installation, make sure you have finished setting up the terminal and Visual Studio Code applications on your machine.

Follow the instructions below to install the latest version of Python:

  1. Windows
  2. Mac
  3. Chromebook

Windows Users

  1. Visit python.org and hover over the Downloads menu. You should see a button to download Python for Windows. Click the button.

  2. After the installer finishes downloading, run it.

  3. On the first settings panel, check the box for Add Python to PATH. Then select the Install Now option.

    First installation panel for Windows. Select the "Add to Path" and "Install Now" options.

    The version number you see might be higher that the one shown in the figure.

  4. Click through the remaining panels and accept the default choices. Once the install is complete, you will be presented with one final settings page. Be sure to select Disable PATH limit length.

    Final installation panel for Windows. Select the "Disable PATH limit length" option.

Mac Users

  1. Visit python.org and hover over the Downloads menu. You should see a button to download Python for Mac OS X. Click the button.
  2. After the installer finishes downloading, run it.
  3. During the installation, accept all of the default options.

Chromebook Users

Warning

If you use a virtual desktop for your programming course, do NOT install VS Code on your device. Use the login information your teacher gave you to access the application.

  1. Visit the Miniconda download page and select the Linux installer for the most recent version of Python.

    Miniconda webpage with the desired Python package indicated.
  2. IMPORTANT: Locate the installation package in the Downloads folder. Drag it into the Linux files folder.

    Drag and drop the Miniconda file into the 'Linux files' folder.
  3. Launch the Terminal application, or open a new terminal panel in VS Code.

  4. Use the following set of commands to start the installation:

    $ pwd
    /home/your_username
    $ ls
    Miniconda3-latest-Linux-x86_64.sh
    $ sudo bash Miniconda3-latest-Linux-x86_64.sh
    

    Note

    The actual Miniconda file name may be different depending on version updates.

  5. During installation, you will be asked several questions:

    1. View and then accept the license terms (yes).

    2. When asked for the installation location, use /opt/miniconda3 instead of the default.

      Miniconda 3 will now be installed into this location /root/miniconda3
      
         - Press ENTER to confirm
         - Press CTRL-C to abort
         - Or specify a different location below
      
      [/root/miniconda3] >>> /opt/miniconda3
      
    3. Finally, enter yes when asked to initialize Miniconda3.

  6. Close and reopen the terminal.

  7. To run Python code, you must activate Miniconda in the terminal with the command source /opt/miniconda3/bin/activate. This will give you access to all of the features and modules installed with the language.

    username:~ $ source /opt/miniconda3/bin/activate.
    (base) username:~ $ python --version
    Python 3.8.3