Created
June 26, 2026 15:28
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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