Python Package Management

PIP

pip is the package installer for Python, use to install packages from the Python Package Index and other indexes.

Most used command options

Updating the pip version:

    pip install -U pip

Get version information and package path information:

    pip -V

Installing a Python package, example: pytest:

    pip install pytest

Uninstalling Python package, example: pytest:

    pip uninstall pytest

Installing a specific Python package version, example: pytest 7.1.1:

    pip install pytest==7.1.1

Listing the installed packages:

    pip list

Saving the list of installed packages:

    pip freeze > requirements.txt

Installing packages from the requirements.txt file:

    pip install -r requirements.txt