Skip to main content

Command Palette

Search for a command to run...

Python's PIP package manager

A guide to installing and using the 'PIP' package manager in python.

Updated
2 min read
Python's PIP package manager
D

Content writer, Interested in AI/ML, Python and entrepreneurship

Introduction

What is a package manager?

A package manager is a collection of tools that are used to simplify the process of installing, updating, and uninstalling packages.

But what is a package...?

A package in Python is a group of modules. What do these modules have? Modules contain a collection of "functions" or "variables." A group of similar modules is called a "package."

When a module is required in a program, you can use it by importing the package it is located in.

Alas, the PIP!

PIP is a package manager used to automate the process of managing packages.

Installation

The PIP package manager comes pre-installed with your latest version of Python. If, for some reason, it's not installed, use the following command to install the pip at its simplest:

python -m ensurepip

This will simply install the PIP if it's not already installed.

To upgrade its version, you can run the following at the command prompt:

py -m ensurepip --upgrade

or

 py -m pip install --upgrade pip

Environment Variables

To use the commands pre-built into "pip" in your Windows system, add the installation path to your environment variables.

Step 1: Search "Environment Variables" in your Windows search and go to "Edit the system Environment Variables."

Step 2: Click on "Environment Variables" and go to "System Variables."

Step 3: Click on "New", name the variable "pip" and give the variable value as the folder where the pip files are located. In my case, they are located at

C:\Users\Dinesh Nalam\AppData\Local\Programs\Python\Python310\Lib\site-packages\pip

Step 4: Click on "OK."

To make sure that "PIP" is installed and working, run the following in the command prompt:

pip --version

This checks whether the "pip" is working properly and displays the version that is currently installed in the system.

Usage

To use the PIP, you can use the format to install your desired Python package.

pip install <package name>

Example: To install a Python package called Numpy, run the following:

pip install numpy

Conclusion

You can use PIP to automate the process of installing and managing your python packages easily.

That's all for now! Hopefully, you learned something new.

If you enjoyed this article, give it a ❤️ so that others can find it too.

- Dinesh Nalam

Twitter | LinkedIn

C

Hey..! Good kick start dinesh keep going:)

1
D

Thanks Aishwarya :)

Python

Part 1 of 1

A series of articles on the Python programming language