Installing Python on Windows 10

Which version to choose 2.x or 3.x?

Which version you ought to use is mostly dependent on what you want to get done.

There are some key issues that may require you to use Python 2 rather than Python 3.

  • Firstly, if you’re deploying to an environment you don’t control, that may impose a specific version, rather than allowing you a free selection from the available versions.
  • Secondly, if you want to use a specific third party package or utility that doesn’t yet have a released version that is compatible with Python 3, and porting that package is a non-trivial task, you may choose to use Python 2 in order to retain access to that package.
  • Another minor downsides for Python 3.x is, slightly worse library support.

For more details on which version to choose? Visit https://wiki.python.org/moin/Python2orPython3

I recommend Python 2.7 because it has the most compatible packages.

Installing Python 2.7.9:

1.Visit www.python.org and navigate to Downloads > Windows and click Python 2.7.9.

Python Website

2. select Download Python 2.7.9 from options.

Python Website

3. Wait for the Python installer to download, and then double click on it.

Downloaded Directory

4. The Python Windows Installer will launch.

Installation Progress

5. In the Python Setup screen, select Install for all users and click Next >.

Installation for all users

6. Leave the destination directory as default and click Next >. (You can also change it if you want e.g. D:\Python27\)

Destination Directory

 

7. Leave the Customize Python 2.7.9 screen as default and select Next >.

Installation settings

8. Wait for the installation to complete.

Finish Installation

9. Once the installation completes, click Finish.

Finish Installation

 

Setting up Environmental variable for Python.

Now we need to add Python to the environment variables. This means when you type “python” into the Windows Command Prompt window (CMD), it will start Python.

10. Right click the Start Menu in the bottom left and select System to load the System menu.

System Variables

11. In the System menu, click on Advanced system settings.

System Variables

12. In the System Properties window, select the Advanced tab and click Environment Variables…

Environment Variables

13. Under System variables, find the variable with the name Path. Click it and choose Edit…

Environment variable edit

14. Being careful to leave the existing values intact, navigate to the end of the Variable value text box. Then append “;C:\Python27\” to the end (without quotes). The semicolon is used to separate the variables. Then click OK to save the update.

(If you have not chosen the default installation directory then choose the path where you have installed Python)

Paste the destination directory path

15. Then click OK on the Environment Variables screen.

Ok Environment variable

16. Click OK on the System Properties screen.

System variable

17. Exit the System menu by clicking X

Closing System Screen

18. Now left click the start menu again and choose Command Prompt to load a new Command Prompt window.

(You can also write CMD on the search bar and click on Command Prompt)

Command Prompt

 

19. Now enter “python” into the window and hit Enter.

CMD

(If you get an error message “Could not found Python  or Cannot recognise python command”, then check you system path variable to see if you have given the correct path)

19. If you type print “hello world” it should output “Hello World” on the screen. Python has been successfully installed.

Confirm installation