Friday, December 5, 2014

Getting Started with Python - Installing Python on Windows

Python is a language that is very easy to learn. A few lines of code can be used to do so much. This tutorial will pretty much show you how to get started with Python on a computer thats running Windows.


  1. We first start by downloading python. Click here to go to the Python downloads page.
  2. I would recommend that you download Python 3.x as Python 2.x is pretter old and is getting out dated. What is currently available for download is Python 3.4.2 and that is the version that I will be working with.
  3. Once you have downloaded Python. Go to your downloads directory, by default its usually 'C:\Users\<your user name>\Downloads' and find 'python-3.4.2.msi'. Double click this and it should show you a nice installer. Pretty easy!


  • This is pretty much like every other installation you've ever done, mostly clicking next, so if you've done any installations in ever, you'll feel pretty much at home. This pretty much what you will see when you open the installer. Click next.
  • This is where you can specify where you want to install Python. I recommend using the default. If you change the location, make sure you remember where you put it. Click next.
  • Next again!
  • It's going to start installing Python on your computer. You might see a black screen pop in and then dissapear, relax, it's all normal. Once the installation is done you will see some thing like whats shown below. Click Finish and tada, you've successfully installed Python on your computer. 

  • So now that we have it installed, go to the location where you installed it. The default location would be 'C:\Python34'. Look for a file called 'python.exe'. Copy the location of the file, eg: 'C:\Python34'
 
  • If you're seeing that file, then you're on the right track. Now for the last thing you have to do. You have to add the location of the 'python.exe' to your path variable.
    • Right click your 'My Computer' icon and go to 'Properties'
    • Click on 'Advanced System Settings', make sure the 'Advanced' tab is selected and look for 'Environment Variables'
    • Scroll through the list of System Variables and look for a variable called Path or PATH. Click on that variable, and click on edit. Bring the cursor to the end of the text that is already in the 'variable value' field and check and see if there is a semi colon, If there isn't add one and then paste the location of the 'python.exe' file we copied previously. So basically you will be pasting 'C:\Python34'. Make sure you add a semi-colon before you paste the location if there already is text in the 'variable value' field.
    • If there is no Path variable you can create one called 'Path' and add the location to the variable value.


  • Congratulations! You have now successfully finished installing Python. To see the version through the command line open the command prompt by hitting the win + R keys to gether and then in the resulting window type cmd and press enter. Now type Python -V. If you did everything right you would see the version of Python that has been installed.




If you like what you see leave a comment and share for everyone! ;)




1 comment: