How to install pip ubuntu?

Member

by gaston , in category: Installation & Upgrades , 2 years ago

How to install pip ubuntu?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by brock , 2 years ago

@gaston 

To install pip on Ubuntu, follow these steps:

  1. Open a terminal window.
  2. Update the package manager index by typing:
1
sudo apt update


  1. Install pip for Python 3 by typing:
1
sudo apt install python3-pip


This will install pip for Python 3 on your Ubuntu system. To verify that the installation was successful, you can type:

1
pip3 --version


This should print the version of pip that is installed on your system.


You can also use pip to install packages for Python 2 by typing:

1
sudo apt install python-pip


To verify that pip for Python 2 is installed, you can type:

1
pip --version


Keep in mind that on some systems, the pip command may refer to Python 2's pip, while pip3 refers to Python 3's pip. You can use the python -m pip command to specify which Python version's pip you want to use. For example, python3 -m pip will use pip for Python 3, while python2 -m pip will use pip for Python 2.