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).
On the next page, scroll to the bottom of the page, you will then see a table that looks like this:
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:
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:
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.
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:
Next select Environmental Variables and under System variables locate the Path variable, then double click on it.
A new window will open up, select New and type the following.
C:\Python35\Scripts
It should look something like this.
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:
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.
Thank you for this tutorial, it saved me a lot of time and made life easier. Much appreciated.
Glad it saved you time, I wrote this for myself, but figured it would be helpful for others too.
Thank you very much sir. Very much appreciated.
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. 🙂
Glad this helped you.
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
Thanks! Nice and clear, it’s much appreciated.
Thanks Matthew! Much appreciated!
THX! That was really helpful.
Hi love you!
Thanks sooo much!
THANKS! for sharing this…. i was driving crazy hahaha
Thanks for the really clear instructions – has saved me lots of time!
Thank you so much, this actually helped me out a tons!
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
Thanks a lot. Tried to install the tensorflow. But the official guide didn’t mention the thing “Add Python 3.5 to PATH “.
Thanks a lot Do you have a tutorial for quandl install as well ?
I don’t, i typically write these posts if i need a reference to installing something that isn’t really clear elsewhere.
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
Hi Shane, PIP should really only be used at the administrator level. I would keep it that way.
thankyou for this complete tutorial ^^
thanks a lot, it helped me so much.
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
Thank you Matthew!
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?
Hi John,
you need to add PIP to your windows enviorment before you can use it in the console.
https://matthewhorne.me/how-to-install-python-and-pip-on-windows-10/#add_pip_windows_enviroment
Regards
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).
Thank you so much… it was very nice way to guide… i was struggling before… but just rock… thanks
thanks Matt.. I feel dumb I can’t figure this out myself, 😀
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.
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!
Thanks Matt. I appreciate your good work. Best!
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
You will need to use command prompt as admin since you are modifying the file structure when downloading modules.
Thank you so much! Easiest and most detailed walkthrough I’ve seen 😀
Muchas gracias, tu tutorial me ha ayudado a instalar Python y pip fácilmente, lo que con otros no conseguÃa.
You are first guy whose blog actually helped me, after a dozen of counterparts.
Thank you and get it going.
Kudos!
Thanks! Easy to understand. This was incredibly helpful.
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?
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.
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
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
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.
Thanks bro!!!
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.
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
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
Thanks a lot. Your Article saved my time to setup python and PIP. For python 3.7, pip automatically installed.
Thank you very very much!
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!
thank you soooo much
this post is a big helpful text for me
thank you so much!
Thank you so much!! This post was so much helpful as it saved my day.