Pip is the standard package manager for the Python programming language. It help you to install and manage packages on your system, which is not a part of the Python standard library. Using Pip you install required dependencies for a Python application. It uses Python Package Index (PyPI) for the packages and install on your system.
In this tutorial, you will learn to install Pip on your Linux based system. Also includes basis commands to work with Pip on your system.
Step 1 – Install PIP
There are several methods available for the Pip installation on any Linux system. You can choose any one method based on your operating system.
- On Ubuntu/Debian Linux – The default apt repositories contains Pip packages for the installation. Use the following command to install Pip on your Debian system.
sudo apt install python3-pip python-dev
sudo apt install python2-pip python-dev
- On Arch Linux – The Arch Linux users can also install pip from official repositories.
pacman -S python-pip
pacman -S python3-pip
Step 2 – Verify Installation
Check the install version of pip on your system using -V command line switch.
pip3 -V# For specific python version
To view a list of helpful commands.
Step 3 – Installing Packages with PIP
Pip provides a simple command to install or uninstall packages on your system. Pip uses the following command to install any packages on your system.
pip install package-name
Also, you can easily remove the package:
pip uninstall package-name
Pip can also take the input from a file for the number of packages to install for a specific application. Add all the required packages name with their version with a properly formatted file like requirements.txt file and execute the following command:
pip install -r requirements.txt