How to activate a python virtualenv without having to go through dozen of folders
I’m working on a couple django apps which use separate virtualenvs and I very often have to source the virtualenv activation script.
It got so tedious that I had to write a small script to automate the finding of the activation script.
The following python script, named “findact”, searches in the recursively for a file named “activate”. If it is not found, it starts again from the parent directory, and so on.
I added a small function to my shell to source the file, if it is found:
This way, I can type “act” to load my virtualenv from anywhere in my project directory.