How to install Python

2 min
  1. Test if Python is already installed on your system
  2. Download Python if it is not already installed on your system
  3. Check if it's correctly added to the PATH or add it so that you can call it directly from the terminal.

How to test if Python is already installed on your system

Open up a terminal

  • Mac : Open up the spotlight and search for terminal
  • Windows : W + R and write cmd
  • Linux : Ctrl + Alt + T for ubuntu

Check the version if python is installed

python3 --version
For python3
python --version
For python

If you end up with an error on both commands then python might not be installed on your system.

Install Python

Download Python & Install Python

Download Python
The official home of the Python Programming Language

Check the version if python is installed

python3 --version
For python3

If you still end up with an error then you will need to tell your computer where your Python is installed by editing the PATH.

Change the PATH on your computer

On MAC or LINUX

export PATH="the/path/where/your/python/executable/is:$PATH"
For python

On windows

For windows it's a bit more complex.

How to set python path in windows 7
I try to set path of python in windows 7, but I can not do that. I go to: My Computer -> Properties -> Advanced > Environment Variables but I don’t know what to do now.please help me

Here you are! You now know how to install Python