Link Twitter Facebook LinkedIn Github Email

Simple Bash virtualenvwrapper

Lately I noticed that virtualenvwrapper has been really slowing down my terminal when it's starting a new shell. I'm not sure why the problem is so much worse now, but just being able to type workon ENV instead of . ~/.virtualenvs/ENV/bin/activate isn't worth opening new terminal windows and waiting 30 seconds (no joke) for Python to fire up a script. So, I stuck this into my .profile file:

function workon(){
    . ~/.virtualenvs/$1/bin/activate
}

and done. No startup lag. If this is all you use virtualenvwrapper for, just ditch it for this bash function.