Hello Friend! Welcome to the ThoughtCoders Python tutorial. In this tutorial, we will learn about PIP and its uses, python-pip installation. The first thing to remember is the use of PIP is to install different packages like Selenium, Pandas, NumPy, and many more. This tutorial helps you to install/uninstall different python libraries using PIP. Learning Python is equally important.
What is PIP
PIP is the package installer for Python package installation and uninstalls. PIP is built under Python Package Index (PyPI) and it is a repository for Python Programming. In like manner, PyPI helps you to find and install software developed by Python Community.
Prerequisite
All things considered, to install PIP or use you must have to install Python. If python is not installed then refer to our previous blog.
How to Install PIP – Python PIP Installation
Case 1: If you are using Python>=2.7.9 or Python3>=3.4 then PIP is already installed with Python and no further installation is required.
Step 1: Check Python Version- Open command Prompt and type python and hit enter.
Step 2 Check PIP Version: Again open the command prompt and type – pip –version and hit enter. You will get the PIP version.
Case 2: If you are using Python < 2.7.9 or PIP is not installed on your machine then you have to follow the steps
Step 3: PIP Installation: Go to the project folder and open the command prompt and type the below command for PIP installation-
python get-pip.py
The above command installs PIP in your project folder.
As a matter of fact, if your organization have proxy and without proxy installation is getting failing then use the below command and pass proxy in command
python get-pip.py --proxy="http://[user:passwd@]proxy.server:port"
Step 4: How to upgrade PIP: To upgrade existing PIP use the below command
python -m pip install -U pip
Step 5: Check for Packages installation: In order to check for packages installation on your machine.
Open command prompt and type command – pip list
This command returns a list of all the installed packages.
Step 6: Install new Packages: Open command prompt and change directory to project root folder
a: To install Selenium Package and run command – pip install –U selenium
b: To verify package installation run command on CMD- pip list
The console displays the newly installed package.
Step 7: To uninstall any package: Open the command prompt and run the below command for uninstall.
pip uninstall package name
for instance, we want to uninstall Selenium so we need to run the command
pip uninstall selenium
Well done! Given these points, you have successfully installed PIP and used to install/uninstall packages. Hope you learned and enjoyed this article. Feel free to share your feedback on query@thoughtcoders.com. Refer to the next tutorial for more Python learning. To that end, for the latest updates on this, do follow us on Facebook and LinkedIn!