Pip (recursive acronym for “Pip Installs Packages” or “Pip Installs Python“) is a cross-platform package manager for installing and managing Python packages (which can be found in the Python Package Index (PyPI)) that comes with Python 2 or Python 3 binaries.
The Pip management tool is especially beneficial for developers who wish to leverage existing code or libraries to build their Python applications without having to start from scratch.
[ You might also like: How to Install the Latest Python from Source in Linux ] In this article, we will demonstrate how to install PIP on popular Linux distributions.
Note: We will execute all commands as the root user. If you are managing your system as a regular user, you can use the sudo command to gain root privileges or configure your system to allow the sudo command without requiring a password, which is feasible.
Installing PIP in Linux Systems
To install pip in Linux, run the corresponding command for your distribution as follows:
Installing PIP On Debian/Ubuntu
To install pip on Debian-based distributions such as Ubuntu and Linux Mint, you can use the apt package manager.
<code>$ sudo apt install python-pip #Python 2 $ sudo apt install python3-pip #Python 3</code>
Installing PIP On CentOS and RHEL
Unfortunately, pip is not included in the official software repositories of RHEL-based distributions such as CentOS Stream, Rocky, and AlmaLinux.
Therefore, you need to enable the EPEL repository and then install pip using the yum package manager.
<code># yum install epel-release # yum install python-pip #Python 2 # yum install python3-pip #Python 3</code>
Installing PIP on Fedora
To install pip on Fedora, you can use the dnf package manager.
<code># dnf install python-pip #Python 2 # dnf install python3-pip #Python 3</code>
Installing PIP on Arch Linux
<code># pacman -S python2-pip #Python 2 # pacman -S python-pip #Python 3</code>
Installing PIP on openSUSE
<code># zypper install python-pip #Python 2 # zypper install python3-pip #Python 3</code>
Using PIP in Linux Systems
To install, uninstall, or search for new Python packages, use these commands.
Searching for a Python Package
To search for packages available on PyPI, you can use the search command:
<code># pip search requests</code>
Installing a Python Package
To install a requests package, open a terminal and use the following command:
<code># pip install requests</code>
Upgrading a Python Package
To upgrade an already installed package to the latest version, you can use the following command:
<code># pip install --upgrade requests</code>
Uninstalling a Python Package
To uninstall a requests package, use the following command:
<code># pip uninstall requests</code>
Listing Installed Python Packages
You can list all the packages that are currently installed using the command:
<code># pip list</code>
Pip Help and Usage
To see a list of all commands type:
<code># pip help</code>
Sample Output:
<code>Usage: pip <command> [options] <p>Commands: install Install packages. download Download packages. uninstall Uninstall packages. freeze Output installed packages in requirements format. list List installed packages. show Show information about installed packages. check Verify installed packages have compatible dependencies. search Search PyPI for packages. wheel Build wheels from your requirements. hash Compute hashes of package archives. completion A helper command used for command completion. help Show help for commands. </p></command></code>
You may also like to read the following related articles about Python.
- Dive Deep Into Python Vs Perl Debate – What Should I Learn Python or Perl?
- Getting Started with Python Programming and Scripting in Linux
- How to Use Python ‘SimpleHTTPServer’ to Create Webserver or Serve Files Instantly
- Python-mode – A Vim Plugin to Develop Python Applications in Vim Editor
In this article, we demonstrated how to install PIP on mainstream Linux distributions. To ask any questions relating to this topic, please use the feedback form below.
The above is the detailed content of How To Install PIP to Manage Python Packages in Linux. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

While writing program files or normal text files, programmers and writers sometimes want to know the difference between two files or two versions of the same file. When you compare two computer files on Linux, the difference between their contents is

There are three ways to create empty files in the command line: First, the simplest and safest use of the touch command, which is suitable for debugging scripts or placeholder files; Second, it is quickly created through > redirection but will clear existing content, which is suitable for initializing log files; Third, use echo"> file name to create a file with an empty string, or use echo-n""> file name to avoid line breaks. These three methods have their own applicable scenarios, and choosing the right method can help you complete the task more efficiently.

Are you looking for good software to write mathematical equations? If so, this article provides the top 5 equation editors that you can easily install on your favorite Linux distribution.In addition to being compatible with different types of mathema

dutree is a free, open-source, fast command-line tool for analyzing disk usage, written in the Rust programming language. It was created by combining durep (disk usage reporter) and tree (list directory content in tree-like format) command-line tools

ifconfig in short “interface configuration” utility for system/network administration in Unix/Linux operating systems to configure, manage, and query network interface parameters via command-line interface or in a system configuration scripts

Eclipse is a free integrated development environment (IDE) that programmers around the world use to write software, primarily in Java, but also in other major programming languages using Eclipse plugins.The latest release of Eclipse IDE 2023?06 does

Linux administrators should be familiar with the command-line environment. Since GUI (Graphical User Interface) mode in Linux servers is not commonly installed.SSH may be the most popular protocol to enable Linux administrators to manage the servers

Linux has a rich collection of commands, and while many of them are powerful and useful for various tasks, there are also some funny and whimsical commands that you can try out for amusement. 1. sl Command (Steam Locomotive) You might be aware of the
