Resolve program script/entrypoint path in virtualenv?

Is there any way to get the path to the current interpreters virtualenv when executing  a debug configuration?

Frequently when debugging something like an Ansible module, what I want to do is execute the Ansible with the debugger attached to the command directly. This can be done by giving a path like $virtualenv/bin/ansible-playbook - which works perfectly, except that there's no way to use a variable - that I can see - for the path to the virtual environment.

This is particularly problematic when working with Poetry, where virtualenv's are not inside the project directory.


1 comment
Please try using `$PyInterpreterDirectory$` macros; it should return the Python intepreter directory. You can read more about IDE Built-in macros on this web page:

Please sign in to leave a comment.