본문 바로가기
【Fundamental Tech】/Ubuntu

[Ubuntu 20.04] How to Install Python Pip

반응형

Installing pip for Python 2

Pip for Python 2 is not included in the Ubuntu 20.04 repositories. We’ll be installing pip for Python 2 using the get-pip.py script.

Start by enabling the universe repository:

$ sudo add-apt-repository universe

 

Update the packages index and install Python 2:

$ sudo apt update

$ sudo apt install python2

 

Use curl to download the get-pip.py script:

$ curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py

 

Once the repository is enabled, run the script as sudo user with python2 to install pip for Python 2:

$ sudo python2 get-pip.py

 

Pip will be installed globally. If you want to install it only for your user, run the command without sudo. The script will also install setuptools and wheel, which allow you to install source distributions.

반응형