Pip
pip is the standard package manager for Python. Understanding pip commands and best practices is essential for managing dependencies effectively. The guide walks through Basic pip Commands, Requirements Files, pip & Virtual Environments, Private Package Repositories, Troubleshooting pip. `pip install requests` installs the latest version. `pip install requests==2.28.0` pins a specific version. `pip install requests>=2.28,<3.0` sets a version range. `pip uninstall requests` removes a package. `pip list` shows all installed packages. `pip show requests` shows package details. `pip check` verifies dependencies are compatible. `requirements.txt` is the standard file format: one package per line, optionally with version specifiers. Use `pip freeze > requirements.txt` to generate from current environment. `pip install -r requirements.txt` installs all dependencies. Split into `requirements-dev.txt` for development tools. Use `-c constraints.txt` for shared version constraints across multiple requirement files. Always install packages inside an activated virtual environment to avoid polluting the system Python. Create with `python -m venv .venv && source .venv/bin/activate`. Configure pip to use a local cache directory: `export PIP_CACHE_DIR=./.pip-cache`. Use `pip install --editable .` to install the current project in development mode.