Hello Friend! Welcome to ThoughtCoders Python tutorial. In this tutorial, we will learn about PIP and its uses. PIP is used to install different packages like Selenium, Pandas, NumPy, and many more. This tutorial helps you to install/uninstall different python libraries using PIP.
What is PIP: PIP is the package installer which is used to Python package installation and uninstalls. PIP is built under Python Package Index (PyPI) and it is a repository for the Python Programming. PyPI helps you to find and install software developed by Python Community.
Prerequisite: 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
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 required.
Step 1: Check Python Version- Open command Prompt and type python and hit enter.
Step 2 Check PIP Version: Again open 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 steps
Step 3: PIP Installation: Go to project folder and open command Prompt and type below command for PIP installation-
Above command install PIP in your project folder.
If your organization have proxy and without proxy installation is getting failing then use 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 below command
python -m pip install -U pip
Step 5: Check installed Packages: To check what are the packages installed on your machine.
Open command prompt and type command – pip list
This command return 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
Newly installed package now displayed on console.
Step 7: To uninstall any package: Open command prompt and run below command for uninstall.
pip uninstall package name
for example, we want to uninstall Selenium so we need to run command
pip uninstall selenium
Well done! 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 firstname.lastname@example.org. Refer next tutorial for more Python learning.