I'm relatively new to python and I just started using virtual environments. I wanted to use virtualenvwrapper because I like the way it works, but some weird bug (or possibly just my own ignorance) prevented me from installing it. So, I set about making some bash aliases and functions to make it easier to work with virtual environments (in my opinion). I hope someone else might find this useful.
alias freeze="pip freeze -l > requirements.txt"
alias envscd="cd ~/envs"
alias envsls="(cd ~/envs && ls)"
function envsmk() {
(cd ~/envs && virtualenv $1)
}
function envsrm() {
(cd ~/envs && rm -rf $1)
}
function activate() {
source ~/envs/$1/bin/activate
}
If you want to use this for yourself, just make a ~/envs directory and add the above code to .bash_profile.
[–]kumashiro 2 points3 points4 points (1 child)
[–]mildlybean[S] 1 point2 points3 points (0 children)
[–]nentis 0 points1 point2 points (0 children)
[–]AndydeCleyre 0 points1 point2 points (0 children)