What is pip?

Understand package managers, PyPI, and why third-party libraries exist

Python's standard library isn't enough

Python ships with a large standard library — modules for files, math, dates, JSON, and more. But the standard library is general-purpose. It doesn't include tools for machine learning, web frameworks, data visualization, or PDF processing.

That's where third-party packages come in. Other developers build and publish packages that solve specific problems. Instead of writing everything from scratch, you install a package and use it.

What is PyPI?

PyPI (Python Package Index) is the central repository where Python packages are published. It hosts over 500,000 packages. When you install a package, Python downloads it from PyPI.

Think of PyPI like an app store for Python code. Package authors upload their libraries, and anyone can install them.

What is pip?

pip is Python's package installer. It downloads packages from PyPI and installs them on your machine. You run pip from the terminal.

pip install numpy

This single command downloads numpy, downloads any packages numpy depends on, and installs everything in the right location. Without pip, you would need to find the source code, download it manually, and figure out dependencies yourself.

Common pip commands

CommandWhat it does
pip install package_nameInstall a package
pip install package_name==1.2.3Install a specific version
pip uninstall package_nameRemove a package
pip listShow all installed packages
pip show package_nameShow details about a package
pip freezeList installed packages in requirements format

Packages you will use in this path

The Build AI Apps with Python path relies on several third-party packages:

PackagePurpose
google-genaiCall the Gemini API for embeddings and text generation
pypdfExtract text from PDF files
numpyCompute vector math for similarity search
python-dotenvLoad API keys from environment files

None of these ship with Python. You install all of them with pip. In the next chapter, you will run your first pip commands.

Next Chapter →