install python 2.7 code example

Example 1: how to install python 2

$ sudo apt install python2
OR
$ sudo apt install python-minimal #is working

Example 2: install python 3.6

conda create -n myenv python=3.6 #to launch in Anaconda

Example 3: latest version of python

# For macs... 
#  Apparently you don't want to upgrade 2.* just install 3.*

% brew install python3

Example 4: install python 3.7

# Go to Python.org and use archives to explore past releases of Python.
# If you're using an IDE like Thonny, install Python 3.7.9 (depends on how updated your IDE is).

# Download your version of Python and click the executable. Then install after receiving the UAC prompt (Windows).