Python - PIP Part 2: Installing Packages Using PIP
One of the primary functions of PIP is installing Python packages. PIP allows you to download and install packages from the Python Package Index (PyPI) with ease.
Example 1: Installing a Package
To install a package, run:
pip install requests
This installs the requests library, which is widely used for making HTTP requests in Python.
Example 2: Installing a Specific Version
To install a specific version of a package, you can specify the version number:
pip install requests==2.25.0
Example 3: Installing Multiple Packages
You can also install multiple packages in one go:
pip install numpy pandas matplotlib
Explanation:
PIP makes it simple to add dependencies to your Python project, either by installing the latest version or by specifying a particular version.