How to Install Python and PIP on Windows 10

Installation Guide Python Windows 10
Liquid Web Storm VPS

Recently I had to install Python on Windows 10, so I could use the “Closure Linter” tool for PhpStorm. Here is a simple guide to show you exactly how to install Python and PIP on your Windows 10 machine.

Download Python

The first step is to download Python from python.org and select the most recent version to install (in this case 3.5.1).

python-latest-version

On the next page, scroll to the bottom of the page, you will then see a table that looks like this:

download-python-installer

You should select “Windows x86-64 executable installer” assuming you have a 64bit system. (why wouldn’t you?)

Install Python

Once it has downloaded, double-click on the installer, you will be presented with the following:

python-installation-options

Note: You must ensure that you select Add Python 3.5 to PATH and then select Install Now.

If the setup ran successfully, you should see a message “Setup was successful message.” Close and continue with the next steps.

Installing and Testing PIP

PIP is a package management system for Python, so you will want to install this handy tool to make your life simpler.

To install PIP first head over to “Get PIP,” you will see something like this:

get-pip

Right-click on the link “get-pip.py” and select “Save Link As…”. Save it to somewhere that is easily accessible from your desktop. Once saved you will see the following on your Desktop.

get-pip-installer

Since you have already installed Python, Windows will now understand that this is a Python script (.py) and will allow you to run it. Just double-click the file and let it run. A command prompt-like window will open and do its thing before closing again.

Add PIP to the Windows Environment Variables

Before you can use PIP you will need to add it to the Windows Environment Variables and to do that open up Control Panel > System and Security > System and select Advanced system settings from the left-hand side, a pop-up will appear like this:

windows-system-properties

Next select Environmental Variables and under System variables locate the Path variable, then double click on it.

windows-system-variables-path

A new window will open up, select New and type the following.

C:\Python35\Scripts

It should look something like this.

add-new-enviroment-variable

Finally click OK on all the opened windows.

How to verify if PIP is working?

To verify if PIP is working just open up command prompt and type “pip.” If it is successful you will get something like this:

testing-pip-command-prompt

Congratulations you have now installed Python and PIP on Windows 10.

Issues

Some users have been having some issues with installing Python, I will list out some solutions as and when I come across them.

error: The TARGETDIR variable must be provided when invoking this installer

Some windows 10 users receive this issue and the solution appears to be to run the installer with command prompt and specify the TARGETDIR (where you want to install Python).

c:\Users\xxxx\Downloads>python-3.6.1-amd64.exe TargetDir=c:\Python36

Note that your path to the installer might be different and your version of python.

Matthew Horne

Matthew is a web developer from the United Kingdom who taught himself PHP and JavaScript and never looked back. If you would like to hire me, shoot me an email.

  • Kyle 27th August 2016, 5:08 am Link Reply

    Thank you for this tutorial, it saved me a lot of time and made life easier. Much appreciated.

    • Matthew Horne 28th August 2016, 6:18 am Link Reply

      Glad it saved you time, I wrote this for myself, but figured it would be helpful for others too.

    • Alexander 23rd May 2018, 10:24 am Link Reply

      Thank you very much sir. Very much appreciated.

  • Andy 23rd September 2016, 6:44 pm Link Reply

    Thanks for sharing this, Matthew. I’m just getting into Python development. I have a Mac, but my Windows desktop is my primary machine. This little tutorial is a big help in making things a bit more consistent between the two environments. 🙂

    • Matthew Horne 29th September 2016, 2:58 am Link Reply

      Glad this helped you.

      • Robby 21st March 2018, 8:10 am Link Reply

        Matthew, being an absolute novice, I want to thank you for the concise and clear step by step explanation for installing Pip so I could then load Pyperclip on Windows 10 in Python 3.6.

        Could you do the same thing for running Python modules from the windows cmd line? I’m struggling with ‘automate the boring stuff’ appendix A and B.

        Thanks
        Robbie

  • DeeBee 26th September 2016, 6:01 pm Link Reply

    Thanks! Nice and clear, it’s much appreciated.

  • Oleg 22nd October 2016, 5:46 pm Link Reply

    Thanks Matthew! Much appreciated!

  • Bart 3rd November 2016, 6:59 pm Link Reply

    THX! That was really helpful.

  • George 17th February 2017, 10:57 am Link Reply

    Hi love you!
    Thanks sooo much!

  • Steven 6th March 2017, 12:58 am Link Reply

    THANKS! for sharing this…. i was driving crazy hahaha

  • Jason 25th March 2017, 11:28 am Link Reply

    Thanks for the really clear instructions – has saved me lots of time!

  • RedAdder 22nd May 2017, 1:23 am Link Reply

    Thank you so much, this actually helped me out a tons!

  • Reja Marjana 27th May 2017, 1:05 am Link Reply

    Thank you very much.. Its really h3lp me when out there everyone just sahare guide about phyton 2.7
    Im new in phyton and going dizzy about that

  • Yue 5th June 2017, 10:18 pm Link Reply

    Thanks a lot. Tried to install the tensorflow. But the official guide didn’t mention the thing “Add Python 3.5 to PATH “.

  • AK 25th June 2017, 1:09 pm Link Reply

    Thanks a lot Do you have a tutorial for quandl install as well ?

    • Matthew Horne 28th June 2017, 6:03 am Link Reply

      I don’t, i typically write these posts if i need a reference to installing something that isn’t really clear elsewhere.

  • Shane 2nd July 2017, 9:04 am Link Reply

    Hi,
    I’ve just installed Python 3.6 on Windows 10- set for all users and added to path. Pip works but only when using a Command Prompt as Administrator- otherwise I get permissions errors when it tries to install the downloaded modules.
    It’s workable but a bit of a pain. Do you have any idea how to resolve this?

    Thanks

    Shane

    • Matthew Horne 6th July 2017, 4:43 am Link Reply

      Hi Shane, PIP should really only be used at the administrator level. I would keep it that way.

  • Anggraini Puspita 10th August 2017, 2:38 am Link Reply

    thankyou for this complete tutorial ^^

  • miguel 27th August 2017, 4:31 am Link Reply

    thanks a lot, it helped me so much.

  • Eric Niyongabo 20th November 2017, 10:09 am Link Reply

    hi, Horne thanks for sharing this articles, it tooks me 4 hours to create pip environment variable with python3 before i found your article. keep up with python articles

  • Brad 3rd January 2018, 3:35 pm Link Reply

    Thank you Matthew!

  • John 17th January 2018, 3:33 am Link Reply

    Hello, I am wanting to use pip to install something, but the command prompt on windows 10 refuses to accept pip. I’m using 3.6+ python wise, so I feel like it had something to do with going into the control panel and typing the whole “python35” thing. However, I have no clue. I’ve tried messing with it, but I can’t figure it out. Any help?

  • Souleiman 19th January 2018, 7:50 am Link Reply

    Thank you so much it’s been 3 links i’ve been throught and it would not work. Just started using libraries on windows (usually it’s Ubuntu).

  • manish singh 25th January 2018, 5:06 pm Link Reply

    Thank you so much… it was very nice way to guide… i was struggling before… but just rock… thanks

  • Arman 13th February 2018, 2:58 am Link Reply

    thanks Matt.. I feel dumb I can’t figure this out myself, 😀

    • Matthew Horne 13th February 2018, 1:58 pm Link Reply

      Nah, the main thing people forget when installing Tools on Windows that require some sort of command line access is that you have to actually add it to the Windows Environment. Kinda lame, but that is the way it is.

  • D M 22nd February 2018, 5:04 am Link Reply

    I have been trying this for 2 hours and this tutorial took me 5 minutes. Thanks!!!! FYI:I never write any positive comments. This is amazing!

  • Bevan 8th March 2018, 3:00 am Link Reply

    Thanks Matt. I appreciate your good work. Best!

  • Lumen 8th March 2018, 7:43 pm Link Reply

    Hello,
    Today i have installed PIP on Windows 10- . Pip is not working fine but when i use command prompt as Administrator- otherwise I get permissions errors when it tries to install the downloaded modules.
    It’s workable but a bit of a pain. Any idea How to get help in Windows 10 installing PIP perfectly ?

    Thanks

    • Matthew Horne 19th March 2018, 6:23 pm Link Reply

      You will need to use command prompt as admin since you are modifying the file structure when downloading modules.

  • M 12th March 2018, 3:32 pm Link Reply

    Thank you so much! Easiest and most detailed walkthrough I’ve seen 😀

  • JOSE MANUEL 12th April 2018, 7:04 pm Link Reply

    Muchas gracias, tu tutorial me ha ayudado a instalar Python y pip fácilmente, lo que con otros no conseguía.

  • Harshit 13th April 2018, 8:20 pm Link Reply

    You are first guy whose blog actually helped me, after a dozen of counterparts.
    Thank you and get it going.
    Kudos!

  • GC 2nd June 2018, 2:14 pm Link Reply

    Thanks! Easy to understand. This was incredibly helpful.

  • Lien 24th June 2018, 4:41 am Link Reply

    Hi Matthew,
    Thanks for your sharing
    But I have 1 question that: As I know “If you’re using Python 2.7.9 (or greater) or Python 3.4 (or greater), then PIP comes installed with Python by default”, why do we still need to install pip?

    • Matthew Horne 12th July 2018, 8:24 pm Link Reply

      If you have PIP installed already, then you won’t need to install PIP again, but you should check to make sure it is registered in your Windows Environment Variables.

  • Vamsi 10th July 2018, 12:33 pm Link Reply

    Hi Matthew,
    This is very simple and good explanation. I just tried and it worked.

    Guys – On another note, if you have installed Python that directory c:\Python35\scripts would have got added to ‘Path’ environment variable. Please check before you add to path.

    Regards,
    Vamsi

  • Javier 25th July 2018, 2:01 pm Link Reply

    Hi Matthew,
    Thanks for your tutorial.
    There is some way to check that python or pip works properly instead just checking if the program starts in the command line? I mean, there is some “test” or “demo” to run python or pip ?
    I’m trying to install ‘cantera’ program and there are errors which are related with file location, but no useful information is given in the error message.
    Best Regards,
    Javier

    • Matthew Horne 26th July 2018, 9:14 pm Link Reply

      Hi, if you type pip in the CMD and it returns some instructions about options related to pip commands then python and pip are installed.

  • Ali 9th August 2018, 11:55 am Link Reply

    Thanks bro!!!

  • Carlos Monge 14th August 2018, 5:32 pm Link Reply

    I tried this but I keep getting the error:The TARGETDIR variable must be provided when invoking this installer.

    Setup failed
    one ore more issues caused the setup to fail. Please six the issues and then retry setup. For more information see log file.

    I have tried several times but to no avail. I successfully installed python 2.71, but can’t get python 3.61 to install. I would like to have
    3.61 to learn more Python.

    • Matthew Horne 16th September 2018, 8:30 am Link Reply

      Hi Carlos,

      This appears to be a bug that affects some users on Windows 10.

      You could open command prompt with admin privileges and run

      c:\Users\xxxx\Downloads>python-3.6.1-amd64.exe TargetDir=c:\Python36

      Note that your path to the installer might be different and your version of python.
      Regards

  • Matthew 18th September 2018, 10:20 pm Link Reply

    Thank you so much for this! I spent forever poking around stack exchange trying to figure out why my cmd wasn’t recognizing ‘python’, only ‘py’, and wouldn’t recognize ‘pip’ at all. This fixed it immediately! Your the best

  • Ramachandra Varma 8th October 2018, 7:11 am Link Reply

    Thanks a lot. Your Article saved my time to setup python and PIP. For python 3.7, pip automatically installed.

  • Jingting Yan 11th October 2018, 1:05 pm Link Reply

    Thank you very very much!

Leave a Comment