pip3 is the official package manager for Python 3 on Linux systems. It is used to install, upgrade and manage Python packages from the Python Package Index (PyPI), handling dependencies automatically and making it easy to add external modules to Python projects.
To install a Python package using pip3, run the following command in your terminal:
pip3 install package_name
Steps to Install PIP3 in Linux
1. Verify Python Installation
Before installing pip3, it's essential to ensure that Python 3 is installed on your Linux system. Open a terminal and type the following command:
python3 --version
checking version of python
This command should display the version of Python 3 installed on your system. If Python 3 is not installed, you can install it using your distribution's package manager.
2. Update Package Manager
Ensure that your system's package manager is up to date. Use the following commands based on your Linux distribution:
For Debian/Ubuntu-based systems:
sudo apt update sudo apt upgrade
For Red Hat/Fedora-based systems:
sudo dnf update
3. Install pip3
Once Python 3 is installed and the package manager is updated, you can install pip3. Use the following command:
For Debian/Ubuntu-based systems:
sudo apt-get install python3-pip
installing pip3 in linux
Note: In this pip3 is already installed in Linux that is why it is displaying 0 upgraded, 0 newly installed.
For Red Hat/Fedora-based system:
sudo dnf install python3-pip
4. Verify pip3 Installation in Linux
To check if pip3 was installed correctly, run:
pip3 --version
This command should display the installed version of pip3.
Verify pip3 installation in Linux5. Upgrade pip3 (Optional)
It's a good practice to upgrade pip3 to the latest version. Use the following command:
sudo pip3 install --upgrade pip
This ensures that you have the latest version of pip3 with bug fixes and new features.