python-pip

How to install Pip on Ubuntu

Overview

Pip is a package management system. Through pip, we can get python package from PyPI. Python is a popular language now a day and its philosophy is readability. It can run on multiple platforms. For install python package PIP is mostly used. There are some ways to install pip in Ubuntu. Some steps of pip install will be described and cover all possible way to install in on your Ubuntu machine. Easily can install latest Ubuntu version and older version.

Pip install

For pip install in the safe side, we can run some command to prepare our ubuntu
In Ubuntu open terminal
(ctrl + alt + t)
sudo apt-get update
sudo apt install build-essential python-dev python-setuptools

Once the update is complete the pip install is very easy for the latest Ubuntu. Only you can run the following code in a terminal
sudo apt-get install python-pip

if need pip install specific python3
sudo apt-get install python-pip

Pip installed successfully.

Pip install with curl

An alternative way to install pip: It is another easy way to install pip by using Curl and python.
sudo apt-get update
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
python get-pip.py

Now verify the pip installation:
Write the pip on the terminal. You can see some codes.

If you want to check the version of
pip -V

Basic Commands of PIP

pip --help

Usage:
pip <command> [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.
config Manage local and global configuration.
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.
--no-color Suppress colored output

Want to search a python package

pip search package_name

Install a new package on virutalenv or root

pip install package_name

Uninstall a package :

pip uninstall package_name

If you really like this post about ‘How to install pip in ubuntu’ and think it is helpful you can share it

Shariful Islam Nayon

Shariful Islam | Full Stack Python/Django Developer I am Linux lover self motivated software craftsman open source contributor.My interested area Data Structure,Algorithm,Big data,Machine learning Dhaka, Bangladesh http://nayon.net/

Leave a Reply


Your email address will not be published. Required fields are marked *