I have used
direnv a couple times, it’s a great way to manage environment variables on a per-directory basis. It nice:
The first step is to install
direnv on the system:
$ sudo apt-get install direnv # Is it ok ? $ direnv --version
Once direnv is installed, you’ll need to configure it. To do this, you’ll need to create a .envrc file in the root of your project directory. This file will contain the environment variables that you want to set for your project.
For example, if you wanted to set the environment variable FOO to bar, you would add the following line to your .envrc file:
$ echo 'layout python' >> .envrc
Once you’ve created your .envrc file, you’ll need to activate direnv:
$ direnv allow
Now, whenever you enter in this directory you’ll load the python virtual environment.
For more, there is the Wiki