Manage python installations with pyenv.
注解
Git needs to be installed and available via PATH if pyenv is to be installed automatically by the module.
v2014.04 新版功能.
salt.modules.pyenv.
default
(python=None, runas=None)¶Returns or sets the currently defined default python.
pyenv.versions
. Leave
blank to return the current default.命令行接口CLI 范例:
salt '*' pyenv.default
salt '*' pyenv.default 2.0.0-p0
salt.modules.pyenv.
do
(cmdline=None, runas=None)¶Execute a python command with pyenv's shims from the user or the system.
命令行接口CLI 范例:
salt '*' pyenv.do 'gem list bundler'
salt '*' pyenv.do 'gem list bundler' deploy
salt.modules.pyenv.
do_with_python
(python, cmdline, runas=None)¶Execute a python command with pyenv's shims using a specific python version.
命令行接口CLI 范例:
salt '*' pyenv.do_with_python 2.0.0-p0 'gem list bundler'
salt '*' pyenv.do_with_python 2.0.0-p0 'gem list bundler' deploy
salt.modules.pyenv.
install
(runas=None, path=None)¶Install pyenv systemwide
命令行接口CLI 范例:
salt '*' pyenv.install
salt.modules.pyenv.
install_python
(python, runas=None)¶Install a python implementation.
命令行接口CLI 范例:
salt '*' pyenv.install_python 2.0.0-p0
salt.modules.pyenv.
is_installed
(runas=None)¶Check if pyenv is installed.
命令行接口CLI 范例:
salt '*' pyenv.is_installed
salt.modules.pyenv.
list
(runas=None)¶List the installable versions of python.
命令行接口CLI 范例:
salt '*' pyenv.list
salt.modules.pyenv.
rehash
(runas=None)¶Run pyenv rehash to update the installed shims.
命令行接口CLI 范例:
salt '*' pyenv.rehash
salt.modules.pyenv.
uninstall_python
(python, runas=None)¶Uninstall a python implementation.
pyenv.versions
命令行接口CLI 范例:
salt '*' pyenv.uninstall_python 2.0.0-p0
salt.modules.pyenv.
update
(runas=None, path=None)¶Updates the current versions of pyenv and python-Build
命令行接口CLI 范例:
salt '*' pyenv.update
salt.modules.pyenv.
versions
(runas=None)¶List the installed versions of python.
命令行接口CLI 范例:
salt '*' pyenv.versions