PyPI and PiP — Python

Khalimbetov Ulgubek
3 min readNov 23, 2020

--

Python is one of the most demanding programming language in the world and Python’s community is vast; diverse and aims to grow. The amount of included libraries in the python is limited, and in order to adjust to our daily tasks we have PyPI.

In this article I will use the term package to refer to a Distribution Package which is different from a Import Package that which is used to import modules in your Python source code.

What is PyPI?

The Python Package Index (PyPI) is a repository of software for the Python programming language.

In other words, Python community creates and share with each other modules and packages, which have been created for a certain purpose and it is open source, which makes easer for everyone to access, modify, redistribute and learn code from PyPI packages.

Moreover, we have over 200 modules in python standard library, the exact number depends upon a distribution, while over 235,000 Python packages can be accessed through PyPI.

Notes:
Module is python scripts or file with a .py extension, and can be used with other .py extensions. Module is able to contain classes, function and implemented variables.
Package is python term. in brief, combined set of modules. Package contains multiple packages and modules and sometimes people use it interchangeable with term libraries. In other words. Package is structure of catalog in which modules are scattered.

Lets see how we can use PyPI.

From scratch, if we want to find a package we need to visit official website https;//pypi.org.

We can either write on search bar, name of the project or description, or click browse project, below from the search bar, where we can use filters to find a package.

What is PiP?

Pip is a package manager for Python, or PiP is an installer that allow you to install any library(package) from PyPI. You’ll need to make sure you have the latest version of pip installed.

The tool plays a significant role for every python programmer that it has been included with Python installer since versions 3.4 for Python 3 and 2.7.9 for Python 2.

How can we use PIP?

Find a package that you want to use.

In this example I will use youtube-dl. The module will allow us to download any YouTube video in several lines.

First of all, we need to open cmd and type.

pip install youtube-dl

We can even put multiple links in a list.

in addition to this we have pip3, pip2 . The difference between them is, if you have an installed python 2.x, it always operates on the Python2 environment only, as well as, pip3 on python3 only.

In mac we have python2 pre-installed as we use pip, it automatically install package on python2, which is not good if you operate on python3 environment.

We use pip for system default python.

If you have pip updated we can use the following command to specify the version of python in which we want to install a package.

pip3.8 install youtube-dl

Here is the an example of the tool that every pythonista have to know about.

--

--

Khalimbetov Ulgubek
0 Followers

Web Developer, Student at Sejong University