Skip to content

Instantly share code, notes, and snippets.

@GeroZayas
Created June 26, 2026 15:28
Show Gist options
  • Select an option

  • Save GeroZayas/a071d22eb425c561e2a90a2b99b6e53c to your computer and use it in GitHub Desktop.

Select an option

Save GeroZayas/a071d22eb425c561e2a90a2b99b6e53c to your computer and use it in GitHub Desktop.
Put this in ~/.zshrc to activate the venv in Python with the "act" alias
unalias act 2>/dev/null
# Activate virtual environments
act() {
for d in .venv env venv .env; do
if [ -d "$d" ]; then
if [ -f "$d/bin/activate" ]; then
source "$d/bin/activate"
echo "Virtual Environment activated: $d"
return
fi
fi
done
echo "No se encontró ningún entorno virtual (.venv, env, .env, venv)"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment