If we need to remove the dependencies of a package as well, we can use the pip show command to view installed packages and remove them manually.Ī file containing all the package names can also be used to install Python packages in batches. In this case, the dependencies ( chardet, urllib3, and certifi) of the requests library aren't uninstalled. Note: Even though the specified package is removed, the packages that were installed as dependencies are not removed. We can do it in the following way: pip uninstall requestsĬ:\Python37\lib\site-packages\requests-2.22.0.dist-info\*Īs we can see, the requests package is removed after the final prompt. Suppose we want to remove the requests library from our current Python environment. We can uninstall a package by using pip with the pip uninstall command. And, Required-by column shows the packages that require requests. Requires column shows which dependencies the requests library requires. Notice the Requires and Required-by column in the above output. Here, the show command displays information about the requests library. Requires: certifi, chardet, urllib3, idna Location: c:\users\dell\desktop\venv\lib\site-packages Let's look at an example: pip show requests The pip show command displays information about one or more installed packages. The pip list command can be used to list all the available packages in the current Python environment. Here, we have installed the 2.11.0 version of the requests library. So, we can define the version of the package in the following way: pip install requests=2.21.0 Sometimes, only a specific version is compatible with other programs. When pip install is used in its minimal form, pip downloads the most recent version of the package. Here, we can see that the pip has been used with the install command followed by the name of the package we want to install ( requests).Īll other dependencies like chardet, urllib3 and certifi required for this package are also installed by pip. Installing collected packages: chardet, urllib3, idna, certifi, requests We can do it with the help of the following command. Suppose we want to install requests, a popular HTTP library for Python. The install command used to install packages using pip.
pip allows us to download and install these packages. Most of these packages are officially hosted and published to the Python Package Index(PyPI). After its installation, a pip command is added which can be used with the command prompt.Īpart from the standard Python library, the Python community contributes to an extensive number of packages tailored for various development frameworks, tools, and libraries. If we are using an older version of Python or do not have pip installed for some other reason, follow the steps as described in this link: pip installation
If pip is already available in the system, the respective pip version is displayed, like: pip 19.3.1 from C:\Python37\lib\site-packages\pip (python 3.7) We can check if pip is installed by using the following command in the console: pip -version Pip comes pre-installed on the Python versions 3.4 or older. If we had installed pip on our system, this command would have installed the numpy library. We can use pip to install additional packages that are not available in the Python standard library.
Pip is the standard package manager for Python.