Pip is the package manager for Python, and it’s essential for installing, searching, and managing packages from the Python Package Index. You might need to use Pip as a regular user to install an app developed using Python. Here’s how to do it.
How to Install Pip on Ubuntu
In most cases, Pip and Python come pre-installed on Ubuntu. If you encounter issues, you may need to reinstall Pip. Follow these steps:
- Open the Terminal:
- Press
Ctrl + Alt + T
to open a terminal session.
- Press
- Check for Python 3:
- Type the following command and press Enter:
python3 --version
- If you don’t see a version number, install Python 3 with:
sudo apt install python3 -y
- Type the following command and press Enter:
- Reinstall Python 3 (if needed):
- If Python is installed but Pip isn’t working, remove Python 3:
sudo apt purge python3
- Then reinstall Python 3:
sudo apt install python3 -y
- If Python is installed but Pip isn’t working, remove Python 3:
- Install Pip:
- If reinstalling Python 3 didn’t fix the issue, install Pip with:
sudo apt install python3-pip -y
- If reinstalling Python 3 didn’t fix the issue, install Pip with:
- Verify Installation:
- Check that Pip is installed by typing:
pip3 --version
- You should see a readout showing the Pip version.
- Check that Pip is installed by typing:
How to Use Pip on Ubuntu
To use Pip on Ubuntu, you’ll need the terminal. Here are some basic commands:
- List all possible commands with Pip:
pip3 --help
- Install a package:
pip3 install <package_name>
For example, to install the packagescrapy
:pip3 install scrapy
- List installed packages:
pip3 list
- Update an installed Python package:
pip3 install --upgrade <package_name>
Here are some additional useful commands:
- Show information about a specific package:
pip3 show <package_name>
- Uninstall a package:
pip3 uninstall <package_name>
Just One More Thing
That’s pretty much all there is to using Pip on Ubuntu. If you’re looking for specific packages, visit the official Python Package Index website to find and download what you need.