Linux – Installing PIP to Manage Python Packages
Python is the most popular language for a decade, and we all know that python had a huge support of libraries that are used in different sectors of Software Engineering. Meanwhile, PIP also getting its fame along with python in Linux and developers community.PIP is a package manager for python in handling the software packages that are developed using python.PIP helps us in keeping track of python packages installed on your system, and complexity increases when two opensource project meets each other i.e installing and using PIP on Linux.
Installing PIP on Linux:
Linux is just a kernel and coming to reality there are a lot of distributions out there. Every distribution had its own respective commands based on the package managers used. Here are some famous distributions.
For Python 2:
$ sudo apt install python-pip python-setuptools
For Python 3:
$ sudo apt install python3-pip
Red Hat Linux:
$sudo yum install python-pip python-devel python-setuptools
$ sudo pacman -S python-pip python3-setuptools
These are the few popular Linux distributions that most people use and by executing the respective commands your machine will be provided with pip package manager on it.
Getting More out of PIP
PIP is like an appstore for python. Using this powerful tool you can enhance your usage and abilities as a Python programmer. Most libraries and frameworks such as Pandas, Numpy, Django, Flask, Matplotlib help you in some crucial tasks like data analysis, visualization of data, Building responsive Websites, etc, and you get all those functionalities through importing those libraries into your code. So PIP takes care of such software packages. Installation, Updating, Upgrading, Degrading of these packages can be handled with some simple commands with the help of PIP. For a short overview just run $ pip(version no) –help in your terminal and this will show some simple syntax and its usage as shown below.
Managing Packages Using PIP
Now we will see some simple tasks like Installing a Package, Upgrading and uninstalling through running some simple commands in your terminal.
Installing a Package
Installing the Latest Version:
$ sudo pip install packageName.
Installing Specific Version:
$ sudo pip install packageName==version number.
Installing Beta version:
$ sudo pip install --pre packageName
Upgrading a Package:
$ sudo pip install --upgrade packageName
Uninstalling a Package:
$ sudo pip uninstall packageName
Listing a Package:
$ pip list --format columns