Get To Know The Most Useful Pip Commands To Help You Install, Manage, and Use Python Software Packages
Get To Know The Most Useful Pip Commands To Help You Install, Manage, and Use Python Software Packages
Get to know the most useful pip commands to help you install, manage, and use Python
software packages.
Terminology
A “distribution” is something that pip can install.
A “package” is something that can be used in import statements.
Most distributions include a single package of the same name, but there are exceptions. For example, pip install attrs
installs a package importable with import attr
A “wheel” is a special file with the suffix .whl
Installing a wheel just copies files into place. No compiling or processing is required.
Custom indexes
Install from an alternative index to PyPI
$ pip install --index-url https://our-pypi-proxy.internal.example.com
Install packages using an *extra index* for local, unpublished externally, packages.
$ pip install --extra-index-url https://local-pacakges.internal.example.com
WHEELs
Produce wheels of the package and all its dependencies,
and put them in the “wheelhouse” directory
pip wheel --wheel-dir ./wheelhouse/ some-package[==version]
Produce wheels of all packages named in requirements file,
and put them in the “wheelhouse” directory
pip wheel --wheel-dir wheelhouse -r requirements.txt