DEV Community

Ajith R
Ajith R

Posted on

Ultimate guide on python PIP

Ultimate Guide On Python PIP

Introduction:
pip stands for Package Installer for Python, which is the standard package manager for python.
Python pip is used to install external packages ,and modules.
In this post I'm going to share some useful pip command that every python programmer must know.
Installing Package using pip:
The pip install command will download and install specified package in your active environment.

pip install package_name

Specifying Package version:
By default pip install the latest version of a package but if you want to install a specific version of package, then use then below command.

pip install package_name == version

Listing Installed Packages:
To list/display all the available packages in the current environment, use the pip list command.

pip list

Package Information:
The pip show command will display information about one or more installed package.

pip show package_name

Uninstalling a package:
We can also uninstall a external package using pip uninstall command.

pip uninstall package_name

Installed Package List
The packages that doesn't come pre-installed with python can be listed/display using the freeze command.

pip freeze

Using Requirements File:
requirements.txt file conatins a list of modules/packages which we need to install for a specific program or project to run.

pip install -r requirements.txt

Creating requirements.txt
To create a requirements.txt file for your project, use the below command.

pip freeze › requirements.txt

Top comments (0)