Skip to main content

Installing Python 3 and 2 in Windows 10 (x64)

This is a tutorial on how to install Python 3 and Python 2 on Windows 10 (x64) and how to use them independently and interchangeably.

Download both versions of python from the official website: https://www.python.org/downloads

For this tutorial I downloaded:

Python 3: https://www.python.org/ftp/python/3.6.3/python-3.6.3-amd64.exe

Python 2: https://www.python.org/ftp/python/2.7.14/python-2.7.14.amd64.msi

You can either install Python 3 or Python 2 first. The idea behind running both versions independently and not interfering with each other is to set the path of one of them in the Environment Variables and other not. This will be clear later in this tutorial.

For me, I wanted to set Python 3 as my primary python (i.e. set in the PATH of Environment Variables) so, I installed it first.

Installing Python 3

  • 1. Open the downloaded Python 3 exe file.
  • 2. [For Default Installation] We will be installing it in the default location [If you want to install it in your desired location go to step 3 and proceed.] So, first select the "Add Python 3.X to PATH" and click "Install Now".
  • 3. [For Custom Installation] If you want to install it in your desired location, choose "Custom Installation" and set the settings as in the pictures below. [Important: Make sure that "Add Python to environment variables" is marked.]
  • 4. After the setup is complete. You can close the installer. [You can disable the path limit if you like but it's not quite necessary for now.]
  • [Optional] To check the "Environment Variables" go to "Control Panel\System and Security\System" and select "Advanced System Settings" and then click "Environment Variables" button on the bottom right corner. To view the Path, select the "Path" field under "System Variables" and click "Edit..." [I do not recommend you to make any changes to the fields if you do not know what you are doing.]
  • Installing Python 2

  • 1. Open the downloaded Python 2 exe file.
  • 2. Select "Install For All"
  • 3. Choose the install location.
  • 4. Make sure the "Add python.exe to Path" is not selected.
  • 5. Click "Finish" to complete the setup.
  • To run Python (both 2 and 3) codes in Sublime Text 3 follow this tutorial: http://algidus.blogspot.com/2017/12/setting-up-sublime-text-3-for-python-2.html