Direnv
For auto load and unloading environments
Install
sudo apt-get install direnv
Configure Your Shell
Add to bash
eval "$(direnv hook bash)"
Reload bash
source ~/.bashrc
Create a .envrc File in Your Project Directory
Navigate to your project directory and create a .envrc file:
cd /path/to/your/project
echo 'export POETRY_ACTIVE=1' > .envrc
echo 'source "$(poetry env info --path)/bin/activate"' >> .envrc
Allow the .envrc File
direnv allow