pip is a package manager that is written in Python. It is used for the installation of Python packages. All python packages are stored in an online repository called Python package index –
pip connects to this online repository and installs the packages on the local system.
All Python distributions greater than the
python 2.7.9 version has pip pre-installed.
pip3 is pre-installed on
python 3.4 and all latest versions. The latest version of pip is
# The below command is used to check the version of pip installed python -m pip --version
# The following command is used to upgrade pip to latest version pip install --upgrade pip
The pip list is a command that can be used to list available packages:
We can use the
pip install command to install any package:
pip install <package-name>
To uninstall any package, use the following command:
pip uninstall <package_name>
A file containing all the package names can also be used to install Python packages in batches.
Suppose we have a file (
Required_Packages.txt) that lists of all the packages to be installed. We can install all these packages and their dependencies using:
pip install -r Required_Packages.txt
Required_Packages file can be created using the
The command used to create the requirement file is:
pip freeze > Required_Packages.txt
The search command can be used to find a specific package in the list of available packages.
The command used to search a package is:
pip search numpy
View all Courses