liveBook · Manning

Pip

As explained in Learn AI-Assisted Python Programming, Second Edition

pip is Python's package installer for downloading and installing software packages and their dependencies.

pip installs Python libraries and lets you request a specific package version when the newest release is incompatible with existing code. section 9.4.2

Pinning a compatible version

When code uses an API removed from PyPDF2 3.0.0, run pip install "PyPDF2 < 3.0.0". pip replaces the installed 3.0.1 release with 2.12.1, allowing the program to run without immediately rewriting it. section 9.4.2

Use pip during practical troubleshooting:

  • Install a library with pip install PyPDF2. section 9.4.2
  • Try another library when version changes or removed functions make the first option unsuitable; PyMuPDF is one alternative. section 9.4.2
Collecting PyPDF2<3.0.0
  Installing collected packages: PyPDF2
  Attempting uninstall: PyPDF2
    Found existing installation: PyPDF2 3.0.1     #1
    Uninstalling PyPDF2-3.0.1:                  #2
      Successfully uninstalled PyPDF2-3.0.1
Successfully installed PyPDF2-2.12.1          #3

Inspect the installation output to verify which version pip removed and which version it installed. section 9.4.2

How Learn AI-Assisted Python Programming, Second Edition covers it

How deep it goes
Demonstrates basic installation, version constraints, output checking, and switching libraries, but not pip internals.
Examples
Uses PyPDF2 versions 3.0.1 and 2.12.1, plus PyMuPDF, to repair a PDF-cover automation program.
What you can do after
Apply it via pip to install a library, constrain its version, inspect installation output, or replace it with an alternative.
How it connects
Connects pip with Python libraries, package versions, API deprecation, and PDF processing.

Also explained in

Compare how 3 books explain pip →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn AI-Assisted Python Programming, Second Edition. The section links point to the parts of the book it draws on.