Full article

How To Install and Manage Python Packages on Linux With PIP

In this tutorial you will learn how to install PIP(Pip Installs Packages). A tool for installing and managing python packages on Linux.

Install PIP on Fedora

python2

sudo yum upgrade python-setuptools
sudo yum install python-pip python-wheel

python3

sudo yum install python3 python3-wheel

Install PIP on CentOS/RHEL

On CentOS 7 you have to install setuptools package first then PIP

python2

sudo yum install python-setuptools

sudo yum install python-pip

python3

sudo yum install python34-setuptools
sudo easy_install pip

Install PIP on openSUSE

python2

sudo zypper install python-pip python-setuptools python-wheel

python3

sudo zypper install python3-pip python3-setuptools python3-wheel

Install PIP on Debian/Ubuntu

python2

sudo apt install python-pip

python3

sudo apt install python3-venv python3-pip

Install PIP on Arch Linux

python2

sudo pacman -S python2-pip

python3

sudo pacman -S python-pip

Verifying if PIP is installed Correctly

Now that PIP is installed on your system, make sure that everything is up to date and running correctly.

All you have to do is run the following command

pip --version

The above command will give you an output like this

That means PIP is up to date and running correctly

Using PIP to manage Packages

Installing and Uninstalling packages with PIP it's relatively easy, all you have to do is call pip and the command you want to execute from terminal.

Installing and Uninstalling a Package with PIP

pip install PackageName #the command to install an software
pip uninstall PackageName #the command to uninstall an software

Installing and Uninstalling a specific version

pip install PackageName==1.0.2  #The command to Install a Specific Version of the Software
pip install 'PackageName>=1.0.2' #The command to Install the Minimum Version of the Software

To get the full list of PIP commands you need run the following command

pip --help

Conclusion

In this tutorial you learned how to manage python packages on Linux with ease with PIP.

Author

Endrit Qerreti

Linux Enthusiast, Coder, Security Researcher, Linux Sys Admin, Night owl.

Comments