Python venv Cheat Sheet/Check VIRTUAL_ENV variable

See which environment is active.

Section: Activate and deactivate

Check VIRTUAL_ENV variable

bash
bash
echo $VIRTUAL_ENV
Explanation

Activation scripts usually set `VIRTUAL_ENV` to the environment path.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Activate and deactivate
Check active python path
Verify the interpreter path after activation.
OpenIn sheetbashsame section
Activate on bash/zsh
Activate a virtual environment on Linux or macOS.
OpenIn sheetbashsame section
Activate with dot shorthand
POSIX shell shorthand for source.
OpenIn sheetbashsame section
Activate in fish shell
Use the fish shell activation script.
OpenIn sheetbashsame section
Activate in csh/tcsh
Use the csh activation script.
OpenIn sheetbashsame section
Activate on Windows CMD
Activate from Command Prompt.
OpenIn sheetbatsame section