Lecture 4: Setting Up Python
Download & Installation Python IDE
-
Step 1: Download Python
-
Step 2: Install Python on Your System
- Windows: The following instructions walk you
through the installation process:
- Launch the Python Installer that you downloaded.
- There are two checkboxes in the installation window:
- 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.
- Select the installation features that are optional. Although Python functions without these features, having them adds to the program's usefulness.
- Advanced options are included in the installation customization section.
- Choose whether to turn off the path length restriction. By selecting this option, Python can get around the 260-character MAX_PATH limit.
- 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:
- 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:
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.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.To go to the screen with the Advanced Options, click Next.
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.
Click Install to begin the installation after making the necessary selections.
The second method is to confirm the Python installation using the GUI. To launch the IDLE, or Python interpreter, take the following actions:
The built-in Python IDE opens when IDLE is run:
The installed Python version appears on the screen in both scenarios, and the editor is operational.
- Windows: The following instructions walk you
through the installation process:
- Visit the official Python downloads page. Select the Download Python button and wait for the file download to finish.
- Run Installer: Use Finder to locate the PKG installer and run it. Go through the installation steps by selecting Continue.
- Select Install to proceed with a standard installation.
- Choose which components to install by selecting Customize.
- 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:- Press Command + N to open Finder.
- Select the Applications directory from the menu on the left side of the screen.
- Open the Python directory.
- Double-click the IDLE icon to start the IDE.
- IDLE shows the installed Python version in the header.
- Linux: Use your package manager to install Python, e.g., `sudo apt install python3` on Ubuntu.
The Installation Type section provides two options:
If you choose to customize your installation, select the components you want and select Install.
Wait for the installation to finish, then select Close to exit the installer.
- The following command could be used to install the latest version of Python on almost every Linux system.
sudo apt-get install python3
sudo apt-get install python3.8
sudo apt-get install python3.9
Type Y and press Enter to continue. The Package manager will download and install the Python for you.
Now Installation is been completed