This article explains how to install Package Installer for Python (PIP) on a Windows Vista system and newer. If you have an older machine, you’ll need to get the slightly older version of Python, such as v3.4.
What to Know
- Install: Open installer > select Add Python 3.7 to PATH > Install Now > wait for confirmation.Next, open Command Prompt > enter print (“Hello World!”).Inspect PIP commands by entering C:\Users\acpke> pip –help.
How to Install PIP on Windows 10
PIP is included out-of-the-box in recent versions of Python, and you’ll need Python anyway for PIP to be of any use.
- Head over to the Downloads page on the website at http://www.python.org to grab the installer for the Python language.
- The main page should provide a convenient button, but in the event, you land on a page with a list of files, make sure you download the Windows x86-64 executable installer or Windows x86 executable installer, depending on whether you have a 32- or 64-bit machine.
- Once downloaded, double-click the installer file.
- On the first screen, select the Add Python 3.7 to PATH option.
- Select Install Now at the top. You can see this will install a couple extra components: IDLE, a Python Integrated Development Environment; documentation on using Python, and PIP itself.
- At this point the installer will do its thing and run through the setup process.
- You’ll see a confirmation screen at the end letting you know the install was successful. You can also select Disable path length limit to change a configuration in Windows that doesn’t allow access to file paths longer than 260 characters.
Using Python on a Windows 10 Machine
Python is a programming language, so to use it you’ll need to learn how to code in it. That’s beyond the scope of this article, but let’s check to see if Python is installed properly.
Head over to the Downloads page on the website at http://www.python.org to grab the installer for the Python language.
The main page should provide a convenient button, but in the event, you land on a page with a list of files, make sure you download the Windows x86-64 executable installer or Windows x86 executable installer, depending on whether you have a 32- or 64-bit machine.
Once downloaded, double-click the installer file.
On the first screen, select the Add Python 3.7 to PATH option.
Select Install Now at the top. You can see this will install a couple extra components: IDLE, a Python Integrated Development Environment; documentation on using Python, and PIP itself.
At this point the installer will do its thing and run through the setup process.
You’ll see a confirmation screen at the end letting you know the install was successful. You can also select Disable path length limit to change a configuration in Windows that doesn’t allow access to file paths longer than 260 characters.
- Open Command Prompt and type the following:
- C:\Users\acpke> python –versionPython 3.7.4
- You should see Python display its version number. You can also check if it’s working correctly by pasting the following code into an empty text file and naming it “hello-world.py” (note the empty line at the end):
- print (“Hello World!”)
- Now run it:
- C:\Users\acpke> python \path\to\hello-world.pyHello World!
Using PIP to Install Python Packages on a Windows 10 Machine
Now that we know Python is functioning, let’s examine PIP.
Open Command Prompt and type the following:
C:\Users\acpke> python –versionPython 3.7.4
You should see Python display its version number. You can also check if it’s working correctly by pasting the following code into an empty text file and naming it “hello-world.py” (note the empty line at the end):
print (“Hello World!”)
Now run it:
C:\Users\acpke> python \path\to\hello-world.pyHello World!
- Although PIP should already be installed, we can check for it by issuing the following at the command prompt:
- C:\Users\acpke> pip –help
- This should show you the Help content for PIP, including the available commands. The most basic one is pip search, which will search the Python Package Index (PyPI) for your search term. For example, suppose we want to create our own custom web browser, the following command will show a list of all the packages in PyPI with the keyword “browser”:
- C:\Users\acpke> pip search browser
- As you can see in the results in the below screenshot, there’s a package called FireSnake-Browser, which is a web browser component already coded in Python. So, instead of having to code things like displaying a page, tabs, and bookmarks, we could just download this and customize it to our needs.
- You can install a package with the following command:
- C:\Users\acpke> pip install FireSnake-Browser
- Unfortunately, updating all installed packages isn’t as easy as updating Linux distributions; you need to do so for each package. When you see it’s out of date run this command to perform the update:
- C:\Users\acpke> pip install FireSnake-Browser –upgrade
- Finally, removing a package is as easy as running this command:
- C:\Users\acpke> pip uninstall FireSnake-Browser
Although PIP should already be installed, we can check for it by issuing the following at the command prompt:
C:\Users\acpke> pip –help
This should show you the Help content for PIP, including the available commands. The most basic one is pip search, which will search the Python Package Index (PyPI) for your search term. For example, suppose we want to create our own custom web browser, the following command will show a list of all the packages in PyPI with the keyword “browser”:
C:\Users\acpke> pip search browser
As you can see in the results in the below screenshot, there’s a package called FireSnake-Browser, which is a web browser component already coded in Python. So, instead of having to code things like displaying a page, tabs, and bookmarks, we could just download this and customize it to our needs.
You can install a package with the following command:
C:\Users\acpke> pip install FireSnake-Browser
Unfortunately, updating all installed packages isn’t as easy as updating Linux distributions; you need to do so for each package. When you see it’s out of date run this command to perform the update:
C:\Users\acpke> pip install FireSnake-Browser –upgrade
Finally, removing a package is as easy as running this command:
C:\Users\acpke> pip uninstall FireSnake-Browser
Get the Latest Tech News Delivered Every Day