Packages & pip

How to get and install pip

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

You will be asked to install curl if not available.

Install pip for python 2.7 or 3.5 for example:

sudo python2.7 get-pip.py
sudo python3.5 get-pip.py

Install a generic package (for example imageio) under python 2.7 and 3.5 respectively:

sudo -H pip2 install imageio
sudo -H pip3 install imageio

How to upgrade pip2 or pip3

sudo pip2 install --upgrade pip
sudo pip3 install --upgrade pip

How to force the upgrade of packages ignoring the previously installed version (can be useful when the package is a distutils installed project and cannot be completely uninstalled before upgrade. Typically occurs if a package is installed with apt-get and then upgraded via pip)

sudo -H pip3 install --ignore-installed package-name

How to see the list of all your installed packages (this is for python 3.5, change the python version if required)

sudo -H python3.5 -m pip list –format=columns
Back