PIP

🛠️ 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 math
  • pandas – for data
  • flask – for web apps
  • requests – for internet requests

You can install any of these using pip!

🧪 Basic Commands

CommandWhat It Does
pip install package_nameInstalls a package
pip uninstall package_nameRemoves a package
pip listShows all installed packages
pip show package_nameDetails 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

    Leave a Reply

    Your email address will not be published. Required fields are marked *