Базовое использование pip
Хотя в Python и есть множество встроенных модулей, которые не нужно устанавливать, иногда программисту нужны инструменты, которых нет в предустановленном наборе. Большинство подключаемых модулей разрабатываются независимыми разработчиками, и загружаются на т.н. Python Package Index (PyPI). Устанавливать пакеты с PyPI или других источников можно с помощью пакетного менеджера pip. Зачастую, он устанавливается вместе с интерпретатором python, но если вы обнаружили, что его в системе нет:
Использовать pip очень просто, а справку по командам можно получить, введя в консоли pip --help
:
$ pip --help
Usage:
pip <command> [options]
pip --help Usage: pip[options] Commands: install Install packages. download Download packages. uninstall Uninstall packages. freeze Output installed packages in requirements format. list List installed packages. show Show information about installed packages. check Verify installed packages have compatible dependencies. config Manage local and global configuration. search Search PyPI for packages. cache Inspect and manage pip's wheel cache. wheel Build wheels from your requirements. hash Compute hashes of package archives. completion A helper command used for command completion. debug Show information useful for debugging. help Show help for commands. General Options: -h, --help Show help. --isolated Run pip in an isolated mode, ignoring environment variables and user configuration. -v, --verbose Give more output. Option is additive, and can be used up to 3 times. -V, --version Show version and exit. -q, --quiet Give less output. Option is additive, and can be used up to 3 times (corresponding to WARNING, ERROR, and CRITICAL logging levels). ...
Или справку по конкретной команде, например, install:
$ pip help install Usage: pip install [options][package-index-options] ... pip install [options] -r [package-index-options] ... pip install [options] [-e] ... pip install [options] [-e] ... pip install [options] ... Description: Install packages from: - PyPI (and other indexes) using requirement specifiers. - VCS project urls. - Local project directories. - Local or remote source archives. pip also supports installing from "requirements files", which provide an easy way to specify a whole environment to be installed. Install Options: -r, --requirement Install from the given requirements file. This option can be used multiple times. -c, --constraint Constrain versions using the given constraints file. This option can be used multiple times. --no-deps Don't install package dependencies. --pre Include pre-release and development versions. By default, pip only finds stable versions. ...
Эта лекция ещё не готова к использованию.