Join us

Install Python into Mac / Windows / Linux Machine.

Photo by Hitesh Choudhary | Unsplash

Cover all steps required to install Python into your Mac or Windows or Linux machine. At the end of this blog you will be ready to start and explore the Python programming world.

Introduction:

In this blog I cover all steps required to install Python into your Mac or Windows or Linux machine. At the end of this blog you will be ready to start and explore the Python programming world.


1.Python on Mac

Since macOS version 10.8 it comes with Python 2.7 pre-installed by Apple. Which you can upgrade or install by following below simple steps below.

i. Check which Python version pre-installed into your mac.

  • Press cmd+space_bar on keyboard & search for terminal.app to open terminal.
  • Type command python --version to check current version of python.
    You will see the pre-installed Python version 2.7.
  • Now type python3 --version to check python3 available in the system,
    if it throw error means version 3 is not available or
    if it give output like Python 3.0 means mac already have Python version 3.

ii. To install Python version 3 into mac.

  • Go to browser and search www.python.org and then click on download tab or click this Python download link.
  • Download latest version of Python for macOS.
  • Double click (open installed file) and follow normal installation steps.
  • At end you will get message Congratuation! Python 3.10.5 for macOS or later was successfully installed.
  • Close the installation window & move downloaded file to bin.

iii. Check Python3 Installation successful or not.

  • Same as above open terminal.app & type python3 --version
  • You will get output as Python with installed version number.
  • If you still get an error restart the terminal and run same command to check installed version.
  • Still got an error then again follow step 2.


2. Python on Windows Machine

Windows Machine not come with pre-installed Python. To install Python on Windows machine follow below steps.

i. Install Python3

  • Go to browser and search www.python.org and then click on download tab or click this Python download link.
  • Download latest version of Python for Windows.
  • Double click (open installed file) and follow normal installation steps.
  • Please follow below necessary steps to have proper installation.
  • First window — Check both option i.e.
    Install Launcher for all users (recommended) &
    Add Python 3.5 to path (to avoid further manual steps to add python environment path)
  • Second window — Check below recommended options
    Install for all users
    Associate files with Python (requires the py launcher)
    Create Shortcuts for installed applications
    Add Python to environment variables
    Precompile standard library
  • Click to install.
  • End window — display message Setup was successful — now close this window.

ii. Check installation successful or not.

You can check python installation by 2 option

  • Click on windows icon and search for Python IDE & press enter.
  • Run command python --version it will display an output with Python and its installed version number.
    1. Using cmd i.e. Windows Command Prompt
  • Click on windows icon & search for cmd & press enter.
  • Run command python this will open same shell as Python IDLE. If it throws means Python not present in your system path.
  • To set Python into system path.
    Click on windows icon and search Environment Variables
    Click on Edit the system environment variables
    Click on Environment Variables
    Select Path and Edit
    Add Python installed directory path along with add ; semicolon at end of path.
  • Now open windows cmd and search python if path added correctly it will open Python IDLE type shell.
  • Run command python --version this will display installed Python version.


3. Install Python on Linux or Ubuntu

Mostly Python not pre-installed into Linux or Ubuntu. To install Python follow below steps.

i. Install Python3

  • Press super_key or windows key & search terminal & press enter.
  • To install write command sudo apt install python3
    It will prompt password enter password to proceed with installation.
  • Once above installation done, install other essential packages like pip, build essential, dev and so on.
    To install all packages in one command run command sudo apt install python3-pip build essential python3-dev
  • Python has been installed successfully to you Linux or Ubuntu machine.

ii. Check Python installation successful or not.

  • On the above same terminal screen type python3 -V to check current version of python.
    You will see the output with Python and its installed version number.


Conclusion:

In this blog, I tried to cover all steps required to install Python into your Mac or Windows or Linux Machine.

I hope you like this blog, feel free to join me on LinkedIn. I love to know your thoughts on this article and feedback.

Thank you for reading.


Only registered users can post comments. Please, login or signup.

Start blogging about your favorite technologies, reach more readers and earn rewards!

Join other developers and claim your FAUN account now!

User Popularity
15

Influence

786

Total Hits

1

Posts