#100DaysOfCode in Python Transcripts
Chapter: Appendix: Python language concepts
Lecture: Concept: pip

Login or purchase this course to watch this video and the rest of the course contents.
0:01 Now that we saw there is over 88 thousand packages at pypi.org, we can just grab and bring into our projects and add great functionality
0:09 HTTP processing, web services, web frameworks, database access, you name it, the question becomes how do we get those form pypi into our system
0:20 or, any distributable package even if we actually just have a zip file of the contents, and the answer is pip. pip knows about the Python Package Index
0:30 and when we type "pip install" a package, here we are typing "pip install requests",
0:34 one of the most popular packages in Python, which is an HTTP client, pip will go and look in a certain location on the Python Package Index.
0:43 And here you can see it found it, it downloaded version 2.9.1 and it unzipped it, installed it in the right location, cleaned everything up, beautiful.
0:51 So, this is how we install something on the command line, if you need to install it machine-wide, you will likely have to do
0:58 "sudo pip install requests" or alternatively on Windows, you will have to running in a command line that is running as administrator.
1:05 Now, be aware, you really want to minimize doing this because when you install one of these things it runs the setup.py file
1:11 that comes with the package that thing can have anything at once in it, and it could do anything that that package want to do to your machine, really,
1:19 you are running as admin some sort of untrusted code, so be aware and try to install it locally,
1:26 but if you've got to install it machine-wide, this is how you do it. If you have Python 3.3 or earlier, you probably don't have pip.
1:33 Some of the new versions of Python 2 do have it, but most of the versions of Python 2 also don't have pip,
1:39 so if you need to get pip, just follow this link and install it, then you carry on in exactly the same way.
1:44 All the newer versions, Python 3.4, and later come with pip included, which is excellent.
1:50 If you are using PyCharm, PyCharm has a really great support for pip as well, here you can see under the preferences tab,
1:57 we found the project interpreter and you can see it's listing a bunch of packages,
2:00 a version and the latest version, some of them have little blue arrows, indicating that we are using an older version rather than a newer version.
2:08 So we could actually upgrade it. The little up arrow in the bottom left, once you select something
2:13 will let you upgrade it and the plus will pull up a listing like a little search box that you can explore all those 88 thousand packages and more.
2:19 So if you are using PyCharm, there is a really nice way to see what packages are installed in your active environment and manage them.


Talk Python's Mastodon Michael Kennedy's Mastodon