Python Installation on Windows, Mac , Ubuntu , Fedora and CentOs

Installing Python on Different Operating Systems

Installing Python on Different Operating Systems

Windows:

  1. Visit the official Python website.
  2. Download the latest Python installer for Windows (32-bit or 64-bit).
  3. Run the installer.
  4. Check the box labeled "Add Python X.Y to PATH" (replace X.Y with the version number).
  5. Click "Install Now" to start the installation.
  6. Open Command Prompt or PowerShell and enter python to verify the installation.

Checking if Python is Installed on Windows

  1. Open the Command Prompt:
    • Press Windows + R, type cmd, and press Enter.
    • OR search for "Command Prompt" in the Start menu.
  2. Type python --version and press Enter.
    • If Python is installed, the version number will be displayed.
    • If not installed, you'll see an error message.

macOS:

  1. Visit the official Python website.
  2. Download the latest Python installer for macOS.
  3. Open the downloaded installer.
  4. Follow the on-screen instructions to install Python.
  5. Open Terminal and enter python3 to verify the installation.

Checking if Python is Installed on Mac

  1. Open the Terminal:
    • On macOS, find it in the Utilities folder within Applications.
    • On most Linux distributions, find it using keyboard shortcuts like Ctrl + Alt + T.
  2. Type python3 --version and press Enter.
    • If Python 3 is installed, the version number will be displayed.
    • If not installed, you might see an error or nothing at all.

Linux (Ubuntu example):

  1. Python is often pre-installed on many Linux distributions. Open a terminal and type python3 or python to check.
  2. If not installed, use the package manager. For example, on Ubuntu:
    sudo apt update
    sudo apt install python3
  3. Access Python by typing python3 in the terminal.

Checking if Python is Installed on Ubuntu

  1. Open the Terminal:
    • On macOS, find it in the Utilities folder within Applications.
    • On most Linux distributions, find it using keyboard shortcuts like Ctrl + Alt + T.
  2. Type python3 --version and press Enter.
    • If Python 3 is installed, the version number will be displayed.
    • If not installed, you might see an error or nothing at all.

Linux (CentOS):

  1. Open a terminal on CentOS.
  2. Use the package manager to install Python. For example:
    sudo yum update
    sudo yum install python3
  3. Access Python by typing python3 in the terminal.

Checking if Python is Installed on Ubuntu

  1. Open a terminal on your CentOS system.
  2. Type the following command and press Enter:
python3 --version

If Python 3 is installed, the version number will be displayed. If it's not installed, you might see an error message or nothing at all.

  1. If Python 3 is not installed and you see an error or nothing, you can also try checking for Python 2:
python --version

However, it's important to note that Python 2 has reached its end of life and is no longer recommended for use.

If neither of the above commands displays a version number, it's likely that Python is not installed on your CentOS system. You can then proceed to install Python using the package manager. Here's the command to install Python 3 on CentOS:

sudo yum install python3

After the installation is complete, you can use the python3 --version command to verify that Python is installed.

Remember that the availability of commands and package names might vary based on the specific version of CentOS and any updates that have occurred.

Linux (Fedora):

  1. Open a terminal on Fedora.
  2. Use the package manager to install Python. For example:
    sudo dnf install python3
  3. Access Python by typing python3 in the terminal.

Always refer to the official Python documentation for the most accurate and up-to-date instructions.

Popular posts from this blog

Python in Industries

All About Python in My Way

History of Python Versions