How to Install PIP On a Mac or Windows Machine
Throughout this course whenever we worked with modules and packages in python they have been either packages that we've created or they have been ones that are built directly into the python language such as the math module.
Guide Tasks
  • Read Tutorial
  • Watch Guide Video
Video locked
This video is viewable to users with a Bottega Bootcamp license

Now we're going to get into the section of the course where we can actually bring in modules and packages that other developers have created and we can use those in our own programs. And the most popular way of doing this is by leveraging a tool called pip and pip is a recursive acronym that stands for either pip installs packages or pip installs python.

What it allows you to do is it allows you to call outside packages that are stored inside of what is called the Pypi store or the cheese shop. And it allows you to bring in all of this python code the other developers have made so that you can use them in your own applications which is a very cool way of being able to build out your systems.

In order to use it, you first have to install it on your system and the installation process is actually going to use just pure python. So you're going to come to this page https://bootstrap.pypa.io/get-pip.py and this is going to work the same way if you're on a Mac or Windows or Linux machine and then you are going to download this file. So you're going to click on get-pip.py and then this is going to bring up this file you can see that this is just a .py file and so you can save this on your machine.

large

large

So save it where ever you know you can have access to it.

Once you have it there all you're going to have to do is open up the terminal and run it like a regular python file. So if I open up the terminal right here all I would have to run is python and then get-pip.py hit return and then it will go and it will install the entire pip library on your system. Now I already have pip installed so I'm not going to run this but that is all you have to do in order to have pip working.

Now to make sure that this is working after you've run that code simply type in pip --version and if it's installed on your system then it is going to show it right here.

If you get an error message it means that you might have an issue say you maybe didn't call the file correctly or you tried to run it on the wrong version of the file or anything like that but assuming everything worked you should have output on the screen right here that says something like pip and then the version. Now if you have a slightly different version that is perfectly fine. I'm working with pip 9.0.1 and then it shows where it is connected and then it also says what version of python that is associated with. So I'm working with python 3.6 and pip 9.0.1

large

So that is how you can install pip on your system and in the next few guides were going to walk through some of the popular packages that you can bring into your program.

Resources