Installing Packages with pip
pip is Python's package manager. Use it to install, update, and manage third-party packages from PyPI (Python Package Index).
10 min•By Priygop Team•Updated 2026
pip Package Manager
pip Package Manager
# pip commands (run in terminal, not Python!)
# pip install package_name # install
# pip install package==1.0 # specific version
# pip install package>=1.0 # minimum version
# pip install -U package # upgrade
# pip uninstall package # remove
# pip list # list installed
# pip show package # package details
# pip freeze # exact versions
# pip freeze > requirements.txt # export deps
# Popular packages to know:
popular = {
"requests": "HTTP library — API calls",
"flask": "Lightweight web framework",
"numpy": "Scientific computing",
"pandas": "Data analysis",
"pytest": "Testing framework",
"beautifulsoup4": "Web scraping",
"pillow": "Image processing",
"click": "CLI framework",
"python-dotenv": "Environment variables",
"black": "Code formatter",
}
print("=== Popular Python Packages ===")
for name, desc in popular.items():
print(f" pip install {name:20s} # {desc}")
# Install from requirements.txt:
# pip install -r requirements.txtTip
Tip
Always install packages in a virtual environment, never globally. Use pip install package-name and pip freeze > requirements.txt.
Diagram
Loading diagram…
Always use virtual environments. pip freeze > requirements.txt. Use pyproject.toml (modern).
Common Mistake
Warning
Installing packages globally pollutes your system Python. Always activate a venv first: python -m venv .venv.
Quick Quiz
Practice Task
Note
(1) Install requests with pip. (2) Check installed packages with pip list. (3) Create requirements.txt with pip freeze.