HostOnNet Blog

pip – Python Package Manager

Looking for Linux Server Admin or WordPress Expert? We can help.

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

On CentOS Server, you can install with

yum -y install python2-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

List all installed packages

pip list

Install requirements for your application

When you build an application in python, that may need multiple modules, you can save these to a file called requirements.txt, to install the modules, run

pip install -r requirements.txt

pip freeze

pip freeze command will list installed modules in format required for requirements.txt

pip freeze

Posted in Python

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.