How to Install pip tool for Managing Package in Ubuntu Linux 18.04

Posted on

This is an article where the main focus is about how to install ‘pip’ tool. According to the manual page exist in the operating system, pip tool has a specific function. It is a tool for installing and managing python packages. One of the example for using this tool usage is in managing packages used in the django-framework based application. The following are steps for installing the ‘pip’ tool.

1. Check first if the ‘pip’ tool is available on the system by executing the following command :

root@hostname:~# apt list --installed | grep pip
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libpipeline1/bionic,now 1.5.0-1 amd64 [installed,automatic]
python-pip/bionic-updates,now 9.0.1-2.3~ubuntu1.18.04.1 all [installed]
python-pip-whl/bionic-updates,now 9.0.1-2.3~ubuntu1.18.04.1 all [installed,automatic]
root@hostname~#
$ pip install virtualenv

2. If it does not exist, just execute the following command to install the ‘pip’ tool :

apt-get -y install pip

3. After successfully install the ‘pip’ tool, try to execute it from the command line. The following is the output for executing the pip command :

user@hostname:~/python$ pip
Usage:   
  pip  [options]
Commands:
  install                     Install packages.
  download                    Download packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  check                       Verify installed packages have compatible dependencies.
  search                      Search PyPI for packages.
  wheel                       Build wheels from your requirements.
  hash                        Compute hashes of package archives.
  completion                  A helper command used for command completion.
  help                        Show help for commands.
General Options:
  -h, --help                  Show help.
  --isolated                  Run pip in an isolated mode, ignoring environment variables and user configuration.
  -v, --verbose               Give more output. Option is additive, and can be used up to 3 times.
  -V, --version               Show version and exit.
  -q, --quiet                 Give less output. Option is additive, and can be used up to 3 times (corresponding to WARNING, ERROR, and CRITICAL logging levels).
  --log <path>                Path to a verbose appending log.
  --proxy <proxy              Specify a proxy in the form [user:passwd@]proxy.server:port.
  --retries <retries>         Maximum number of retries each connection should attempt (default 5 times).
  --timeout <sec>             Set the socket timeout (default 15 seconds).
  --exists-action <action>    Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.
  --trusted-host <hostname>   Mark this host as trusted, even though it does not have valid or any HTTPS.
  --cert <path>               Path to alternate CA bundle.
  --client-cert <path>        Path to SSL client certificate, a single file containing the private key and the certificate in PEM format.
  --cache-dir <dir>           Store the cache data in <dir>. 
  --no-cache-dir                    Disable the cache. 
  --disable-pip-version-check 
                             Don't periodically check PyPI to determine whether a new version of pip is available for download. Implied with --no-index.
user@hostname:~/python$

If the above output command appear after executing the above command, it means ‘pip’ installation is a success.

Leave a Reply