Pyper, for Python, is a package management system which can be used to install and manage software packages written in python. Considered an essential for the python community, pip is installed by default in Python 2 > 2.7.9 or Python 3 >=3.4 and in all virtual environments created by virtualenv or pyenv.
Pip, just like any other python package, has versions of its own. To upgrade pip to its latest version, run

pip install -U pip ( Linux/ macOS )
python –m pip install –U pip ( Windows )

Installing packages using PIP

Pip supports installing from Pypi, VCS, local projects and directly from distribution files. To install the latest version of a package from Pypi, run the following commands from cmd:

pip install <package-name>

To install a specific version of the package, try:

pip install <package-name> == <package-version>

Similarly, a minimum package version can be specified by

pip install <package-name> >= <package-version>.

* For pip install to work, either the Python path variable should be set or the current working directory of your cmd instance should be in the Scripts folder of your Python Installation.

Using a requirements file

A requirements file is a file that contains a concrete list of all dependencies for that version of the project. Factfully, a requirements.txt file for python project requirements is a list of pip installs for the dependencies of the project.

openpyxl==2.5.3
pafy==0.5.4
Pillow==5.1.0
PyAutoGUI==0.9.36
pygame==1.9.3
pyHook==1.5.1

This is a sample portion of a requirements.txt created by the cmd: pip freeze > requirements.txtTo install the requirements from the requirements.txt, run pip install -r requirements.txt

Installing from wheels

‘Wheels’ are archive format files used to greatly speed installation. To install directly from a wheel file:

pip install <My_Package_whl_name>.whl
to uninstall, try –pip uninstall <My_Package_Name>

Share This