Python Docs

Python PIP – Full Cheat Sheet

What is PIP?

PIP is Python's official package manager. It allows you to install and manage Python packages (also called modules).

If you are using Python 3.4 or later, PIP comes pre-installed.

What is a Package?

A package contains all the files needed for a module (functions, classes, data, etc.).

PIP makes it easy to download, install, update, and remove packages.

Check if PIP is Installed

Open your command prompt and run:

pip --version

Install a Package

Use the install command:

pip install camelcase

Now the package is installed and ready to use in your Python code.

Using an Installed Package

After installing a package, import it into your Python file.

Example: Using camelcase

import camelcase

c = camelcase.CamelCase()

txt = "hello world"

print(c.hump(txt))

Find New Packages

Browse and search packages at: https://pypi.org/

Uninstall a Package

Remove a package using:

pip uninstall camelcase

PIP will ask for confirmation (y/n).

List Installed Packages

pip list

This shows all packages installed in your current Python environment.

Summary

  • PIP manages Python packages.
  • Use pip install <package> to add packages.
  • Use pip uninstall <package> to remove packages.
  • Use pip list to see installed packages.
  • Use pip --version to confirm PIP is installed.
  • Packages are downloaded from PyPI.