Installing Python on Windows, Mac, or Linux is a straightforward process that can be completed in a few simple steps. In this guide, we will walk through the installation procedure for each operating system.
Python is the most used programming language in the world. Many developers use it for different purposes. You can do web development. data analysis and artificial intelligence using it. But before using python on your system its obvious you have to first install python on your windows or Mac or Linux System.
Installing Python on Windows
Below are the steps to install python on Windows.
- Visit the official Python website: Open your preferred web browser and go to the official Python website.
- Go to the Downloads section: On the Python website, click on the “Downloads” tab located on the top navigation menu. This will take you to the Python Downloads page.
- Choose the Python version: Scroll down to the section labeled “Python Releases for Windows” and select the download link for the latest stable version of Python. Make sure to choose the correct version (either 32-bit or 64-bit) based on your system architecture.
- Download the Python installer: On the download page, you will see a list of available installer files. Choose the “Windows installer” option, which will download an executable (.exe) file to your computer.
- Run the Python installer: Locate the downloaded Python installer (.exe file) and double-click on it to run it. Windows may prompt you for permission to run the installer; click “Yes” to proceed.
- Configure the installation: On the installation wizard, you can customize the installation options. It is recommended to check the box that says “Add Python to PATH” to include Python in your system’s PATH environment variable. This will allow you to run Python from any command prompt window without specifying the full path to the executable.
- Choose the installation location: Choose the destination folder where Python will be installed. By default, Python will be installed in
XXrepresents the version number.
- Complete the installation: Once you have configured the installation options, click on the “Install” button to begin the installation process. The installer will copy the necessary files and set up Python on your system.
- Verify the installation: After the installation is complete, open a command prompt window by pressing
Win + Rand typing
cmd. In the command prompt, type
python --versionand press Enter. If Python is installed correctly, the command prompt will display the installed Python version.
Congratulations! You have successfully installed Python on your Windows system.
Installing Python on Mac
- Visit the official Python website: Open your web browser and go to the official Python website.
- Go to the Downloads section: Click on the “Downloads” tab located on the top navigation menu of the Python website. This will take you to the Python Downloads page.
- Choose the Python version: Scroll down to the section labeled “Python Releases for Mac OS X” and select the download link for the latest stable version of Python. Make sure to choose the correct macOS version and select the macOS 64-bit installer (.pkg file).
- Download the Python installer: On the download page, click on the macOS installer (.pkg file) to start the download process. The installer file will be saved to your default download location.
- Run the Python installer: Once the download is complete, locate the downloaded installer file (.pkg) and double-click on it to run it. macOS may prompt you for confirmation; click “Continue” to proceed with the installation.
- Start the installation: The installer will open a setup wizard. Click on the “Continue” button, review the software license agreement, and click “Continue” again. You will be prompted to select the destination where Python will be installed and choose the installation type. Keep the default options selected and click “Install” to begin the installation process.
- Authenticate the installation: macOS may prompt you to enter your administrator password to authenticate the installation. Enter your password and click “Install Software” to continue.
- Complete the installation: Wait for the installation process to complete. Once it is finished, you will see a “The installation was successful” message. Click “Close” to exit the installer.
- Verify the installation: Open a Terminal window by navigating to
Terminal. In the terminal, type
python --version, and press Enter. If Python is installed correctly, the terminal will display the installed Python version.
Congratulations! You have successfully installed Python on your Mac.
Installing Python on Linux
Installing Python on Linux can be done using package managers or by building from a source. In this tutorial you will know the installation of python using package managers, which is the recommended method for most Linux distributions.
- Open the terminal: Launch the terminal on your Linux distribution by pressing
Ctrl + Alt + Tor by searching for “Terminal” in your application launcher.
- Update the package manager: Before installing Python, it is a good practice to update your package manager’s repository information and software packages. Run the following command:
sudo apt update
Install Python: Depending on your Linux distribution, the package name for Python may vary. Use the appropriate package manager based on your Linux distribution:
- For Ubuntu or Debian-based distributions, use the following command:
sudo apt install python3
- For Fedora or Red Hat-based distributions, use the following command:
sudo dnf install python3
Verify the installation: After the installation is complete, you can verify it by typing the following command in the terminal:
If Python is installed correctly, the terminal will display the installed Python version.
Congratulations! You have successfully installed Python on your Linux system.
In this post, you have learned why python is popular among developers. You have learned how to download python from the site and install it on windows and MacOS. You have also learned how you use the package manger to install python on the Linux operating system.