HostOnNet Blog


pip – Python Package Manager

pip is python package manger.

https://pip.pypa.io/en/stable/

To install pip, run

wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py

On Ubuntu, you can install with

apt install python-pip

Install a package with pip

To install a package with pip, run

pip install PACKAGE-NAME

Example

pip install fabric

Upgrade a package

To upgrade a package, run

pip install -U PACKAGE-NAME

Here we upgrade package paramiko

root@hon-pc-01:~# pip list | grep paramiko
paramiko (1.16.0)
root@hon-pc-01:~# pip install -U paramiko
Collecting paramiko
  Downloading paramiko-2.1.2-py2.py3-none-any.whl (172kB)
    100% |████████████████████████████████| 174kB 79kB/s 
    --- removed ---
Successfully installed appdirs-1.4.3 asn1crypto-0.22.0 cffi-1.10.0 cryptography-1.8.1 enum34-1.1.6 idna-2.5 ipaddress-1.0.18 packaging-16.8 paramiko-2.1.2 pyasn1-0.2.3 pycparser-2.17 pyparsing-2.2.0 setuptools-34.4.1
root@hon-pc-01:~# pip list | grep paramiko
paramiko (2.1.2)
root@hon-pc-01:~# 

After upgrade, we have latest version 2.1.2

List all installed packages

pip list

Posted in Python