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 numpyThis 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
| Command | What it does |
|---|---|
pip install package_name | Install a package |
pip install package_name==1.2.3 | Install a specific version |
pip uninstall package_name | Remove a package |
pip list | Show all installed packages |
pip show package_name | Show details about a package |
pip freeze | List 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:
| Package | Purpose |
|---|---|
google-genai | Call the Gemini API for embeddings and text generation |
pypdf | Extract text from PDF files |
numpy | Compute vector math for similarity search |
python-dotenv | Load 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.