How to Install Python and PIP on Windows 10

Installation Guide Python Windows 10

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.

      • Ọlánrewájú Adàgbà 15th June 2019, 12:55 pm Link Reply

        Thank you. I applied everything you wrote and it worked. I am new in programming. Can you please help me on this journey?

    • 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!

  • matt 24th October 2018, 6:03 am Link Reply

    Hi, Just wanted to let you know that out of the hours I spent traipsing the internet, it was your explanation which finally helped me to get pip working on windows 10!

  • marzi 9th November 2018, 1:38 pm Link Reply

    thank you soooo much
    this post is a big helpful text for me

  • Tobias 27th November 2018, 8:26 pm Link Reply

    thank you so much!

  • sulab thapa 24th January 2019, 1:56 pm Link Reply

    Thank you so much!! This post was so much helpful as it saved my day.

  • Satya 12th February 2019, 12:24 am Link Reply

    Thank you. It helped a great deal.

  • Rasha 13th February 2019, 9:28 pm Link Reply

    Thanks, this is a helpful.

  • Isaac Spiller 17th February 2019, 2:45 pm Link Reply

    Hello Mr. Horne! These instructions seem simple enough but its just not working for me. I’ve followed all the steps and then enter ‘pip’ into the command prompt but it says “‘pip’ is not recognized as an internal or external command,
    operable program or batch file.” I would really appreciate it if you could give me a nudge in the right direction from here. Thank you for your help!

    • Matthew Horne 2nd June 2019, 9:55 am Link Reply

      Did you add PIP to your Global Environments Variables?

  • Hamdi Abd 21st February 2019, 7:47 pm Link Reply

    Thank u so much

  • Kamran 27th March 2019, 6:06 am Link Reply

    Hey,

    Environment path may be different for different versions of python, the command below helped me:
    %PYTHON_HOME%\;%PYTHON_HOME%\Scripts\

    Hope it helps others too.

  • Joe 13th May 2019, 6:34 pm Link Reply

    Thank you for posting this guide! It’s the only one that worked for me.

  • Barney Quark 15th June 2019, 1:13 am Link Reply

    First rate! A Kali nerd who knows nothing about Windows, much less the cloud, was able to install python and pip in a Win 10 instance. Thanks.

  • Jerónimo D'Alessandro 24th June 2019, 1:19 pm Link Reply

    Hi guys,

    I’m trying to install Python 3.7.3 on my laptop with windows 10 but I can’t. I already installed the Visual Studio but I can’t with python. I’m getting the target dir error every time, I already invoked from CMD with a specific targetdir, and same is happeing. Note this is the computer from the place I work for, but as it let me install the visual studio I shouldn’t get any troubles. Any ideas what could I do?

    • Matthew Horne 15th July 2019, 5:51 am Link Reply

      It is still possible that the computer has certain restrictions since you mentioned it is a work computer. You may have to speak to your IT department to see what they can do.

  • Konstantina B 8th December 2019, 3:06 pm Link Reply

    Sadly it didn’t work. I have installed python3.8 and for some reason I keep getting @’pip.’ is not recognized as an internal or external command,
    operable program or batch file.@

    • Matthew Horne 21st January 2020, 9:56 am Link Reply

      That means that pip has not been added to your PATH, please look at the section “Add PIP to the Windows Environment Variables” and make sure that the path to pip is correct.

  • Al Watt 15th December 2019, 7:37 pm Link Reply

    Brilliant! Works nicely thanks.

  • pushkar singh 17th January 2020, 1:37 pm Link Reply

    I have been practicing codes with different languages. Currently, I tried using python and I am not able to install pip and I have tried all possible known means to install pip. It throws an error “OSError: [Errno 9] Bad file descriptor” Each time I try Installing pip. Plz, guide me.

    • Matthew Horne 21st January 2020, 9:53 am Link Reply

      This would indicate that the file you downloaded is incomplete, possibly corrupted or it could be something in your systems environment preventing the exe from writing. Try re-downloading it and running it as Administrator.

  • Simon 15th June 2020, 6:51 pm Link Reply

    “Get PIP”

    There is no such link on python.org or your website. So i got the file from the link given here

    https://pip.pypa.io/en/stable/installing/

    pointing to https://bootstrap.pypa.io/get-pip.py

  • Markos 27th June 2020, 5:38 am Link Reply

    Hey guys, i’m trying to install python3.8.3 with pip.. but i’m getting an empty Script folder… everytime i use the python get-pip.py this occurs:
    C:\Users\user\Desktop>py get-pip.py
    Traceback (most recent call last):
    File “get-pip.py”, line 23484, in
    main()
    File “get-pip.py”, line 198, in main
    bootstrap(tmpdir=tmpdir)
    File “get-pip.py”, line 83, in bootstrap
    from pip._internal.commands.install import InstallCommand
    File “”, line 991, in _find_and_load
    File “”, line 975, in _find_and_load_unlocked
    File “”, line 655, in _load_unlocked
    File “”, line 618, in _load_backward_compatible
    File “”, line 259, in load_module
    File “C:\Users\user\AppData\Local\Temp\tmpmnj8681o\pip.zip\pip\_internal\commands\install.py”, line 24, in
    File “”, line 991, in _find_and_load
    File “”, line 975, in _find_and_load_unlocked
    File “”, line 655, in _load_unlocked
    File “”, line 618, in _load_backward_compatible
    File “”, line 259, in load_module
    File “C:\Users\user\AppData\Local\Temp\tmpmnj8681o\pip.zip\pip\_internal\cli\req_command.py”, line 16, in
    File “”, line 991, in _find_and_load
    File “”, line 975, in _find_and_load_unlocked
    File “”, line 655, in _load_unlocked
    File “”, line 618, in _load_backward_compatible
    File “”, line 259, in load_module
    File “C:\Users\user\AppData\Local\Temp\tmpmnj8681o\pip.zip\pip\_internal\index\package_finder.py”, line 21, in
    File “”, line 991, in _find_and_load
    File “”, line 975, in _find_and_load_unlocked
    File “”, line 655, in _load_unlocked
    File “”, line 618, in _load_backward_compatible
    File “”, line 259, in load_module
    File “C:\Users\user\AppData\Local\Temp\tmpmnj8681o\pip.zip\pip\_internal\index\collector.py”, line 14, in
    File “”, line 991, in _find_and_load
    File “”, line 975, in _find_and_load_unlocked
    File “”, line 655, in _load_unlocked
    File “”, line 618, in _load_backward_compatible
    File “”, line 259, in load_module
    File “C:\Users\user\AppData\Local\Temp\tmpmnj8681o\pip.zip\pip\_vendor\requests\__init__.py”, line 114, in
    File “”, line 991, in _find_and_load
    File “”, line 975, in _find_and_load_unlocked
    File “”, line 655, in _load_unlocked
    File “”, line 618, in _load_backward_compatible
    File “”, line 259, in load_module
    File “C:\Users\user\AppData\Local\Temp\tmpmnj8681o\pip.zip\pip\_vendor\requests\utils.py”, line 27, in
    File “”, line 991, in _find_and_load
    File “”, line 975, in _find_and_load_unlocked
    File “”, line 655, in _load_unlocked
    File “”, line 618, in _load_backward_compatible
    File “”, line 259, in load_module
    File “C:\Users\user\AppData\Local\Temp\tmpmnj8681o\pip.zip\pip\_vendor\requests\_internal_utils.py”, line 11, in
    File “”, line 991, in _find_and_load
    File “”, line 975, in _find_and_load_unlocked
    File “”, line 655, in _load_unlocked
    File “”, line 618, in _load_backward_compatible
    File “”, line 259, in load_module
    File “C:\Users\user\AppData\Local\Temp\tmpmnj8681o\pip.zip\pip\_vendor\requests\compat.py”, line 65, in
    File “”, line 991, in _find_and_load
    File “”, line 975, in _find_and_load_unlocked
    File “”, line 671, in _load_unlocked
    File “”, line 779, in exec_module
    File “”, line 915, in get_code
    File “”, line 973, in get_data
    OSError: [Errno 9] Bad file descriptor

    Any solution so i can start doing my work?

    • Matthew Horne 28th June 2020, 8:19 am Link Reply

      “OSError: [Errno 9] Bad file descriptor”

      This would indicated the the file cannot be read or written to. How are you installing it?

  • YOUSF 23rd July 2020, 12:00 pm Link Reply

    I have windows8 so this work for Windows8 also ?

    • Matthew Horne 18th August 2020, 1:53 pm Link Reply

      It should do.

  • Dayan Perera 13th August 2020, 9:23 am Link Reply

    Thanks man, this tutorial was a godsend

Leave a Comment