0Pricing
Python Academy · Lesson

Installing Packages with pip

Use pip to install, upgrade, and uninstall third-party packages.

Installing Packages with pip is a free Python Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Python Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Introduction

pip is Python's package installer. It downloads packages from PyPI and manages your project's dependencies.

pip install

pip install requests installs the requests package from PyPI into your current environment.
# Terminal:
# pip install requests
print('install demo')

pip install with version

pip install requests==2.28.0 pins to exact version. requests>=2.25 installs minimum. requests~=2.28 allows patch updates.
# pip install 'requests>=2.25,<3'
print('version pinning demo')

requirements.txt

pip freeze > requirements.txt saves all installed packages. pip install -r requirements.txt restores them.
# Generate: pip freeze > requirements.txt
# Restore:  pip install -r requirements.txt
print('requirements demo')

pip list and show

pip list shows all installed packages. pip show requests shows details about a specific package.
# pip list
# pip show requests
print('list demo')

pip uninstall

pip uninstall requests removes the package. -y skips the confirmation prompt.
# pip uninstall requests -y
print('uninstall demo')

pip upgrade

pip install --upgrade requests upgrades to the latest version.
# pip install --upgrade pip
# pip install --upgrade requests
print('upgrade demo')

pip check

pip check verifies that all installed packages have compatible dependencies.
# pip check
print('check demo')

PyPI vs Private Registries

pip install -i https://my.registry.com/simple/ package uses a private index instead of PyPI.
# pip install --index-url https://test.pypi.org/simple/ mypackage
print('registry demo')

uv: The Fast Alternative

uv is a Rust-powered replacement for pip and virtualenv — 10-100x faster. uv pip install requests works the same way.
# curl -LsSf https://astral.sh/uv/install.sh | sh
# uv pip install requests
print('uv demo')

Security: pip audit

pip-audit scans installed packages for known CVEs. Run it in CI to catch vulnerable dependencies early.
# pip install pip-audit
# pip-audit
print('audit demo')

Quick Check

Which command saves all currently installed packages to a file?

Recap

pip: install, install -r, freeze, list, show, uninstall, upgrade, check. Pin versions for reproducibility. uv is a faster modern alternative.

Keep Going

Excellent! Continue to the next lesson to deepen your skills.

Frequently asked questions

Is the “Installing Packages with pip” lesson free?

Yes — the full text of “Installing Packages with pip” is free to read here on the web, and the Python Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Python Academy course, upgrade to CoddyKit PRO.

What will I learn in “Installing Packages with pip”?

Use pip to install, upgrade, and uninstall third-party packages. You practise Python Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Python Academy?

No prior experience is required. Python Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Installing Packages with pip” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Python Academy lesson?

Yes. Every Python Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Creating and Importing Modules
  2. The Python Standard Library
  3. Packages and __init__.py
  4. Installing Packages with pip
← Back to Python Academy