Skip to content

Commit

Permalink
Add documentation for exec command (pyenv#2090)
Browse files Browse the repository at this point in the history
  • Loading branch information
sandipanpanda authored Oct 2, 2021
1 parent bb6a747 commit 0688b17
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 0688b17

Please sign in to comment.