poetry Virtual environment already activated

It's similar to activating a normal virtual environment. But we need to find out path of the poetry virtual env.

We can find the path via poetry env info --path

source $(poetry env info --path)/bin/activate

Explained in this poetry demo.


poetry shell is a really buggy command, and this is often talked about among the maintainers. A workaround for this specific issue is to activate the shell manually. It might be worth aliasing the following

source $(poetry env info --path)/bin/activate

so you need to paste this into your .bash_aliases or .bashrc

alias acpoet="source $(poetry env info --path)/bin/activate"

Now you can run acpoet to activate your poetry env (don't forget to source your file to enable the command)


I'd have to do the following

source "$( poetry env list --full-path | grep Activated | cut -d' ' -f1 )/bin/activate"