These states manage system installed python packages. Note that pip must be installed for these states to be available, so pip states should include a requisite to a pkg.installed state for the package which provides pip (python-pip in most cases). Example:
python-pip:
pkg.installed
virtualenvwrapper:
pip.installed:
- require:
- pkg: python-pip
Make sure the package is installed
Example:
django:
pip.installed:
- name: django >= 1.6, <= 1.7
- require:
- pkg: python-pip
This will install the latest Django version greater than 1.6 but less than 1.7.
Example:
django:
pip.installed:
- name: django >= 1.6, <= 1.7
- bin_env: /foo/.virtualenvs/bar
- require:
- pkg: python-pip
Or
Example:
django:
pip.installed:
- name: django >= 1.6, <= 1.7
- bin_env: /foo/.virtualenvs/bar/bin/pip
- require:
- pkg: python-pip
Attention
The following arguments are deprecated, do not use.
Changed in version 0.17.0: use_wheel option added.
install_options
Extra arguments to be supplied to the setup.py install command. If you are using an option with a directory path, be sure to use absolute path.
Example:
django: pip.installed: - name: django - install_options: - --prefix=/blah - require: - pkg: python-pip
Extra global options to be supplied to the setup.py call before the install command.
New in version 2014.1.3.
Attention
As of Salt 0.17.0 the pip state needs an importable pip module. This usually means having the system's pip package installed or running Salt from an active virtualenv.
The reason for this requirement is because pip already does a pretty good job parsing it's own requirements. It makes no sense for Salt to do pip requirements parsing and validation before passing them to the pip library. It's functionality duplication and it's more error prone.
Make sure that a package is not installed.
Current Salt release: 2014.1.6
Docs for previous releases on salt.rtfd.org.