How to install Python (v3.X.X or v2.x.x)February 15, 2018
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.
- First go to https://www.python.org/downloads/ and download your required python version.
- 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.
- 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.
- Right Click on Computer/MYPC and click on properties.
- Then Click on Advance System Settings.
- Then go to Advance tab -> And click on Environment Variables.
- Then Select Path by scrolling and Edit it.
- 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.
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
Follow the below steps for uninstall:
sudo rm /usr/bin/python3
sudo ln -s python3.5 /usr/bin/python3