Python PIP
📦 Python PIP (Complete Guide)
PIP stands for:
Package Installer for Python
It is used to install, update, and remove Python libraries and packages from PyPI (Python Package Index).
✔️ Check if PIP is Installed
Open your Command Prompt / Terminal and type:
Example output:
🧩 Installing Packages with PIP
To install a Python package:
Example:
🔄 Upgrade a Package
Example:
❌ Uninstall a Package
Example:
📋 Show Installed Packages
🔍 Search for Package
Example:
📁 Installing from requirements.txt
Often in real projects (e.g., Django), you will see a file named requirements.txt.
It contains a list of required packages for a project.
Example file content:
To install everything:
📤 Freeze Installed Packages
This saves your installed package versions into a file:
💡 Useful PIP Commands Table
| Command | Description |
|---|---|
pip --version |
Check pip version |
pip install pkg |
Install package |
pip uninstall pkg |
Remove package |
pip install --upgrade pkg |
Update |
pip list |
Show installed packages |
pip freeze > req.txt |
Save package list |
pip install -r req.txt |
Install from file |
🧪 Example: Using Installed Package
Install:
Use in Python:
🛠 Fixing PIP Error: “pip is not recognized”
If pip doesn’t work, install:
Windows:
or
Mac/Linux:
🚀 Summary
| Feature | Supported by PIP |
|---|---|
| Install packages ✔ | |
| Update packages ✔ | |
| Remove packages ✔ | |
| Manage dependencies ✔ | |
| Project requirements ✔ |
