Python PIP

Python PIP: Package Manager

What is PIP?

PIP is a package manager for Python packages, or modules if you like. If you have Python version 3.4 or later, PIP is included by default.

What is a Package?

A package contains all the files you need for a module. Modules are Python code libraries you can include in your project.


Checking if PIP is Installed

Navigate your command line to the location of Python's script directory, and type the following:

pip --version

Downloading a Package

Downloading a package is very easy. Open the command line interface and tell PIP to download the package you want.

Download a package named "camelcase":

pip install camelcase
Now you have downloaded and installed your first package!

Using a Package

Once the package is installed, it is ready to use. Import the "camelcase" package into your project.

import camelcase

c = camelcase.CamelCase() txt = "hello world" print(c.hump(txt)) # Output: Hello World


Removing a Package

Use the uninstall command to remove a package:

pip uninstall camelcase
The PIP Package Manager will ask you to confirm that you want to remove the camelcase package. Press `y` and `Enter`.

List Packages

Use the list command to find all the packages installed on your system:

pip list

Note: PIP commands are executed in your computer's terminal/command prompt, not inside the Python script itself!