Last active
February 28, 2021 19:42
-
-
Save ines/c00535e6ac294750ddba95fd24a77db5 to your computer and use it in GitHub Desktop.
Command to activate / create Python virtual environmment
This file contains 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
function venv { | |
default_envdir=".env" | |
envdir=${1:-$default_envdir} | |
if [ ! -d $envdir ]; then | |
python -m venv $envdir | |
pip install ipython black flake8 | |
echo -e "\x1b[38;5;2m✔ Created virtualenv $envdir\x1b[0m" | |
fi | |
source $envdir/bin/activate | |
export PYTHONPATH=`pwd` | |
echo -e "\x1b[38;5;2m✔ Activated virtualenv $envdir\x1b[0m" | |
python --version | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's a fish port of the same script: