Lecture 4: Setting Up Python
Download & Installation Python IDE
  • Installation and Environment Setup
    • Step 1: Download Python
      Download Python
      Visit the official Python website at python.org and download the latest version. The download page provides options for Windows, macOS, and Linux.

    • Step 2: Install Python on Your System
      Install Python
      Follow the installation instructions for your OS:
      • Windows: The following instructions walk you through the installation process:
        1. Launch the Python Installer that you downloaded.
        2. There are two checkboxes in the installation window:
      • Administrator Rights. Whether Python is installed for all system users or only the current user is determined by this argument. You can modify the Python installation folder with this option.
        Include Python in PATH. After installation, the executable is added to the PATH variable by using the second option. Later on, you can explicitly add Python to the PATH environment variable.

        Install Python
      • We advise checking both items for the easiest installation.
      • To proceed with the suggested installation, select Install Now (if you choose to skip the next two steps).
      • Select Customize installation instead, then move on to the next step to modify the default installation settings.
      • Install Python

        Python is installed by default for the current user at C:\Users\[user]\AppData\Local\Programs\Python\Python[version]. It comes with extra documentation, the PIP package manager, and the standard Python editor, IDLE. Additionally, the installer sets up the required file associations and shortcuts when possible.
        Modifying the installation enables you to alter these parameters and options.

      • Select the installation features that are optional. Although Python functions without these features, having them adds to the program's usefulness.
      • Install Python

        To go to the screen with the Advanced Options, click Next.

      • Advanced options are included in the installation customization section.
      • Make the decision to install Python for every user or not. The install location is altered by this option to C:\Program Files\Python[version]. Since it doesn't have spaces in the path and is accessible by all users, C:\Python[version] is a popular option when choosing the location manually. Both routes could result in problems installing packages because of administrative rights.

        Additional advanced options are to add Python to PATH, create file associations, and create shortcuts.

        Install Python

        Click Install to begin the installation after making the necessary selections.

      • Choose whether to turn off the path length restriction. By selecting this option, Python can get around the 260-character MAX_PATH limit.
      • Install Python
      • Verify Python on Windows Using the command line is the first method to confirm that Python was installed successfully. Execute the subsequent command after launching the command prompt:
      • Install Python

        The second method is to confirm the Python installation using the GUI. To launch the IDLE, or Python interpreter, take the following actions:

        • Locate the system directory where Python was installed.
        • Double-click IDLE or python.exe, which is the Python interpreter.
        • The interpreter displays the following window when the command prompt opens:
        Install Python

        The built-in Python IDE opens when IDLE is run:

        Install Python

        The installed Python version appears on the screen in both scenarios, and the editor is operational.

  • For macOS Installation Setup
      • Visit the official Python downloads page. Select the Download Python button and wait for the file download to finish.
      • Install Python
      • Run Installer: Use Finder to locate the PKG installer and run it. Go through the installation steps by selecting Continue.
      • Install Python

        The Installation Type section provides two options:

        • Select Install to proceed with a standard installation.
        • Choose which components to install by selecting Customize.
        Install Python

        If you choose to customize your installation, select the components you want and select Install.

        Install Python

        Wait for the installation to finish, then select Close to exit the installer.

        Install Python
      • Verify Installation: Test the new installation by checking the Python version, as described in the Check if Python Is Installed on Mac section above.
        Alternatively, if you installed GUI applications, verify the Python installation by locating and opening IDLE, Python's native integrated development environment. Follow the steps below to find IDLE on your system:
        1. Press Command + N to open Finder.
        2. Select the Applications directory from the menu on the left side of the screen.
        3. Open the Python directory.
      • Install Python
      • Double-click the IDLE icon to start the IDE.
      • Install Python
      • IDLE shows the installed Python version in the header.
      • Install Python
      • Linux: Use your package manager to install Python, e.g., `sudo apt install python3` on Ubuntu.
  • For Linux Installation Setup
      • The following command could be used to install the latest version of Python on almost every Linux system.
      •                                                 sudo apt-get install python3
                                                        
                                                    
      • Also, you can mention the particular version of Python you want to install, shown below :
      •                                                 sudo apt-get install python3.8 
                                                        
                                                    
                                                        sudo apt-get install python3.9
                                                        
                                                    
        Install Python

        Type Y and press Enter to continue. The Package manager will download and install the Python for you.

        Install Python

        Now Installation is been completed

        Install Python