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 --versionInstall a Package
Use the install command:
pip install camelcaseNow 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 camelcasePIP will ask for confirmation (y/n).
List Installed Packages
pip listThis 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 listto see installed packages. - Use
pip --versionto confirm PIP is installed. - Packages are downloaded from PyPI.