Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

run

Run a command inside a virtualenv without activating it in the parent shell — useful for CI, one-shot scripts, and editor integrations.

Usage

scoop run <env> [--] <command> [args...]

The -- separator is optional but recommended when <command> accepts flags that might collide with scoop’s own flags.

Arguments

ArgumentRequiredDescription
envYesName of the virtualenv
commandYesProgram (and arguments) to execute

Environment Wiring

The spawned child sees the same vars that scoop activate would set:

VariableValue
VIRTUAL_ENVAbsolute path of the env
SCOOP_ACTIVE<env>
PATHEnv’s bin/ prepended to inherited PATH
PYTHONHOMERemoved

A bare program name (no / or \) is looked up inside the env’s bin/ first — so scoop run env -- python always picks the env’s interpreter, not a system one. An explicit path (/usr/bin/python3) is used verbatim.

Exit Codes

scoop run exits with the child’s exit code. On Unix, a child killed by a signal exits as 128 + signum (matching what bash exposes via $?).

Examples

scoop run myenv -- python script.py
scoop run myenv -- pip install requests
scoop run myenv -- pytest -vv tests/
scoop run myenv -- which python   # absolute path inside myenv