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.
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?)
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.
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.
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).
Note that your path to the installer might be different and your version of python.