Python Package Manager PIP
Introduction:
When you install Python, it comes up with a collection of default packages called Python standard library. It solves many problems while coding, but it might only solve some of them. To solve issues related to projects we need external libraries which are not part of standard libraries. PIP provides the interface to install and manage these libraries or packages. PIP looks for packages in PYPI and installs them on your local machine. Pip will install any other packages in which a module or package is required.
PIP in Action:
Get Shankar Duraisamy’s stories in your inbox
Join Medium for free to get updates from this writer.
To know the version of the pip
pip --versionTo install the package using PIP
#pip install package_name
pip install sqlite3To install a package with a specific version
#pip install package_name==version
pip install sqlite3==3 0.5.3Pip will support the conditions while installing the package.
#pip install package_name>=lower_version<higher_version
pip install sqllite>=3.0.3.0 <3.0.5.4We can add all the requirements to the requirements file and give it pip, it will install all at once.
#requirement.txt
pip install sqllite>=3.0.3.0 <3.0.5.4
panada
decouple==3.0.3.0
pip install -r requirements.txtwe can list the packages installed on the projects
pip listWe can freeze the requirement and take a snapshot of the projects related to the external packages.
pip freeze > req.txtUpgrade a package
#pip install --upgrade package_name
pip install --upgrade sqllite
pip install -r requirements.txt --upgradeUninstall a package
# pip uninstall package_name
pip uninstall sqliteSummary of the package
#pip show package_name
pip show sqliteCheck for broken dependencies
pip checkclear the pip cache
pip cache purgeInstall a pip
python has a build-in package “ensurepip” which is designed to install pip
python -m ensurepip



