A Beginner's Guide to pip (Summary)
You’ve seen that pip
is a package manager for Python, used by many projects to manage dependencies. It’s included with the Python installer, which makes it an essential tool for all Pythonistas to know how to use.
Python provides an extensive standard library suitable for developing all sorts of applications, but the active Python community provides an even larger set of tools and libraries that speed up Python application development.
These tools and libraries are published to the Python Package Index (PyPI), and pip
allows developers to install them in their application environments.
In this course, you learned about:
- Installing new packages using
pip
in the command line and with requirement files - Managing dependencies, separating development and production requirements, and creating a locked requirements file
- Finding packages through
pip
and PyPI - Evaluating package dependencies before uninstalling a package and how
pip
uninstalls packages
In addition, you learned about the importance of keeping dependencies up to date and alternatives to pip
that can help you manage those dependencies.
Feel free to reach out in the comments section below with any questions you might have, and you can always get more information at the pip
documentation page.
Congratulations, you made it to the end of the course! What’s your #1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment in the discussion section and let us know.
00:00
In this course, you’ve learned how to perform the most common package management functions using pip
. You learned the basics of how Python programs run within your operating system; how virtual environments can be used to resolve installation issues; how to install and manage packages using pip
, the Python package manager; how package managers make managing dependencies easier; how to find new packages with PyPI; and finally, how to evaluate package dependencies before uninstalling one. I’m Austin Cepalia with realpython.com. Happy coding!
Alan ODannel on May 27, 2020
A nice pip refresher course. I picked up a couple of tips that I wasn’t aware of.
Simon Keating on May 28, 2020
Great overview that will help me avoid frustrations experienced working across multiple computers and environments.
Antonio Soares on May 29, 2020
This was very cool. I had a very loose understanding of packages and some vague awareness of virtual environments (or I think I did) through the Anaconda Navigator. Using virtual environments and keeping track/upgrading dependencies is something I never thought possible and it’s very cool how it’s been implemented. I’m not a software developer so I’m very impressed with how these basic functionalities can help keep a programmer sane when the complexity starts to pile up later on.
mohamedawad on June 6, 2020
I am from windows aisle, is still sinking. Thanks
rkrao15 on June 12, 2020
Thanks Austin, this was very cool course, really very informative. :)
velmuruganv on June 24, 2020
Thanks !. Nice one.
ellefore on July 2, 2020
Very helpful course!
paolotagliente on July 9, 2020
Thanks, contents were clear, direct and useful! good job!
a5zima on July 20, 2020
Could you clarify for me: if a new project is automatically started with conda enviroment (by PyCharm IDE), is it correct to use pip in the terminal of this project or I need to use only conda’s command inside conda? Thank you.
Alain Rouleau on July 24, 2020
Lots of great info, thanks!
Santosh on Aug. 20, 2020
Love it, very succinct.
Ghani on Oct. 27, 2020
Very useful course; I filled a few gaps. Thank you very much!
fosterlee on Dec. 29, 2020
I didn’t realize you could bind a package version:
# requirements.txt
requests>=2.21.0, <3.0
…the comma – and everything after – was all new to me!
Thanks!
Matyi on March 30, 2021
Very useful course, it summed up a lot of things in just a half an hour what I had learned from years of experiences. Even I filled a few gaps. Thank you very much!
Pedro Faria on May 2, 2021
You can still improve this lecture by using slides that show diagrammatic views of the files, programs, directories and their relationships, as well as operations. It’s much more pleasant than having to constantly look at the command line, especially because you can give an overview of what you’re about to explain. This goes for every lecture in this website: separate each video into conceptual view (or conceptual explanation) and application. Also, avoid introducing terms and concepts in an ad-hoc fashion. If you’re going to talk about something, always mention it beforehand. Cheers
Oliver Frolovs on July 8, 2022
I think I finally understood the bewildering landscape of environment isolation and dependency management tools in Python. Thank you!
cjf1994 on Aug. 25, 2022
This was a good overview. I’m new to Python and this course made Pip way less confusing!
paulfwatts on Dec. 14, 2022
A great refresher and picked up many useful tips.
Thank you for the course!
pocsgeza on Sept. 22, 2023
It was good short course BUT it had a bit of clickbait.
It showed in the beginning a scenario where the installation of a package is successful but import is still not possible. I think this part was not covered in enough detail.
One of the issues I personally keep getting stuck on is installing packages locally so they can be imported in to tests that in different folders (code in src folder and test in tests folder.
Become a Member to join the conversation.
Marat Sabirov on May 26, 2020
Awesome! I already used Anaconda on Windows, and now I know how it works on Linux. Big Thx to Austin =)