Index
๐ ๏ธ What is pip?
pip is Python’s package manager.
It helps you install, update, and uninstall external Python libraries.
Think of it like the Play Store or App Store, but for Python packages.
โ
Why Use pip?
Python has many useful libraries (packages) like:
numpyโ for mathpandasโ for dataflaskโ for web appsrequestsโ for internet requests
You can install any of these using pip!
๐งช Basic Commands
| Command | What It Does |
|---|---|
pip install package_name | Installs a package |
pip uninstall package_name | Removes a package |
pip list | Shows all installed packages |
pip show package_name | Details of a specific package |
๐ฆ Example: Installing a Package
Let’s install the requests package (used to make web requests):
pip install requests
โ After that, you can use it in Python:
import requests
response = requests.get("https://example.com")
print(response.status_code)
๐ซ Uninstall a Package
pip uninstall requests
๐ See Installed Packages
pip list
โ Where to Run These Commands?
Run pip commands in your terminal or command prompt:
- Windows: Command Prompt or PowerShell
- Mac/Linux: Terminal
๐ Bonus Tip: Check pip version
pip --version
If pip isn’t working, you may need to install or upgrade it using:
python -m ensurepip --upgrade
๐ฏ Summary
pip= Python package installer- Installs useful libraries from the Python community
- You run it in the terminal, not inside a Python file
