How to install Python (v3.X.X or v2.x.x)

How to install Python (v3.X.X or v2.x.x)

February 15, 2018 0 By Nitikesh Pattanayak

To start with python, please make sure that python is installed on your Local/remote PC/System.

If not already installed, then please follow the steps to install it on your OS.

For Windows:

  1. First go to https://www.python.org/downloads/ and download your required python version.
  2. After download has been completed, Double click on the setup file to start the installation. Follow the GUI instructions to install Python into your System.
  3. After the installation has been completed mark the line where it’s mentioned that “set Environment variable automatically”.

What is Environment Variable?

An environment variable is a dynamic-named value that can affect the way running processes will behave on a computer. They are part of the environment in which a process runs.

E.g: If you have a exe file to run, then you have to double click on it to run it. Or you have to open Command Prompt and go to that particular location then open it. But if you set the environment variable for that particular exe file, then you can access it from anywhere via CMD.

In Python, If i will not set environment variable then i have to always go to c:\\python for accessing python.exe file.

But if i will set the environment variable then i can use python.exe anywhere from cmd by typing “python <options>

If you have not set the Environment variable, Then follow the below steps to set the environment variable.

  1. Right Click on Computer/MYPC and click on properties.
  2. Then Click on Advance System Settings.
  3. Then go to Advance tab -> And click on Environment Variables.
  4. Then Select Path by scrolling and Edit it.
  5. After that Add the location where you have installed the python. In my case its “C:\\python\\”

After Environment variable has been set, you can access Python from your command Prompt.

 

For Linux:

Ubuntu:

Follow the below steps for installation:

sudo add-apt-repository ppa:jonathonf/python-3.6

sudo apt-get update

sudo apt-get install python3.6

sudo update-alternatives --config python3

python3 -V

Follow the below steps for uninstall:

sudo rm /usr/bin/python3
sudo ln -s python3.5 /usr/bin/python3