What is Python pip?

Estimated read time 1 min read

pip is the package installer for Python. It is a command-line tool that allows you to install, upgrade, and manage Python packages and dependencies from the Python Package Index (PyPI). PyPI is a repository of software packages developed and shared by the Python community.

Here are some common pip commands:

  • Install a Package:
  pip install package_name

This command installs the specified package.

  • Install a Specific Version of a Package:
  pip install package_name==version_number

This allows you to install a specific version of a package.

  • Upgrade a Package:
  pip install --upgrade package_name

Upgrades an already installed package to the latest version.

  • Uninstall a Package:
  pip uninstall package_name

Removes a previously installed package.

  • List Installed Packages:
  pip list

Displays a list of installed packages along with their versions.

pip simplifies the process of managing external libraries and tools for Python projects. It automatically resolves dependencies and retrieves the necessary packages from PyPI, making it a convenient tool for developers to maintain a clean and well-organized environment for their Python projects.

Related Articles