An overview to Pip — Part 1

Nidhi Jakhad
4 min readDec 11, 2021

--

Synopsis —

What is Pip?

Pip is python’s package manager — what does it mean?

Well, using python provides built-in modules/ packages that we can easily use and extend the functionality of our code. Some of them already come installed while downloading python’s standard library but for others, we have to download them manually and this is being done with help of Pip.

Other programming languages also have package management systems. For instance — In Java, Maven is a package manager, etc.

Checking pip in your system with version

Open command prompt and type pip

If pip is already downloaded in your system, then it will lead to the above result. Else, first, you have to download it. How to download-Download and install pip Latest Version — GeeksforGeeks

Although, pip comes already installed with python if you have python version above 3.4.

Checking version of Pip-

You can see that I have pip version- 21.3.1 and then it shows the location of pip in the pc.

Installing and Uninstalling Packages-

Firstly, let’s check whether we have pandas already or not- so, there is show command — pip show package name

You can see pandas is not already present. So, let’s go ahead and install it using install command

Pip install package name

Hence, pandas successfully installed? Let’s check with show command
Voila, yes, it is!

More description on show command: — It gives you the version, one-line summary of the package as well as its author, author’s email, homepage, location (in your pc) and its dependencies means what other packages are required in order to function this package. So, for pandas to function -numpy, pytz, python-dateutil are also required. You don’t need to worry because when pandas was installing it remembers what is needed so, it installed its dependencies (other packages) with itself.

Now, maybe you want to uninstall it- simply use — pip uninstall package name

It asks you whether are you sure that you want to uninstall pandas- Type Y
Package uninstalled

Again, you can go ahead and check with show command, you will find — package(s) not found pandas

Hence, that is how you can install or uninstall any package! But remember if you try to install/uninstall /show a package that doesn’t exist it will throw an error. It is always better to check online whether the package you are typing really exists or not?

List, Upgrade commands:

If you want to check which packages are already present use list command-

For ex: pip list

These are the packages that are already present in my system.

Now, let’s check if there is any package whose version is outdated:

There is no package on my pc which is outdated but if we need an older version of a package let’s say we need an older or a specific version of requests library. In that case, we can degrade it by specifying the required version
The current version is 2.26.0 and we want to degrade it to 2.25.1
pip install — — upgrade requests=2.25.1
Now, the version is 2.25.1

In order to install the older i.e 2.25.1 version, we need to upgrade it to this version. If we don’t specify a version with an upgrade command then it upgrades the package with the latest version available.

Let’s again get the same version or the latest of requests i.e 2.26.0

The latest version of requests is installed. You can check with show command!

Pip help, search commands-

Pip help — pip help basically helps you to find various pip commands –

And pip search — let you search anything inside PyPi website which is Python package index.
This command doesn’t work directly so to resolve it first install pip -search
Now, we have installed pip-search!

Let’s search about scrapy now

So, you will get a one-line description of everything related to scrapy that is presented on PyPi.

It also provides you the refer link see — https://pypi.org/search/?q=scrapy

STAY TUNED FOR THE NEXT PART!!! where I am going to cover Requirement.txt, virtual environments, and much more.

Drop in your suggestion. Thanks for reading!

--

--

Nidhi Jakhad

Loves to write on Research, Values, Leadership, Python, Finance-Markets(coming soon) | Eager to Acquire Consulting skills| Photographer- addicted to aesthetics