Add documentation for exec command (#2090)

This commit is contained in:
sandipanpanda 2021-10-03 01:45:18 +05:30 committed by GitHub
parent bb6a747c02
commit 0688b17cc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,6 +16,7 @@ The most common subcommands are:
* [`pyenv versions`](#pyenv-versions)
* [`pyenv which`](#pyenv-which)
* [`pyenv whence`](#pyenv-whence)
* [`pyenv exec`](#pyenv-exec)
* [`pyenv root`](#pyenv-root)
* [`pyenv prefix`](#pyenv-prefix)
* [`pyenv hooks`](#pyenv-hooks)
@ -282,6 +283,21 @@ Lists all Python versions with the given command installed.
2.7.6
3.3.3
## `pyenv exec`
`Usage: pyenv exec <command> [arg1 arg2...]`
Runs an executable by first preparing PATH so that the selected Python
version's `bin` directory is at the front.
For example, if the currently selected Python version is 3.9.7:
`pyenv exec pip install -r requirements.txt`
is equivalent to:
`PATH="$PYENV_ROOT/versions/3.9.7/bin:$PATH" pip install -r requirements.txt`
## `pyenv root`
Displays the root directory where versions and shims are kept.