helper for use with virtualenv

(cherry picked from commit 683afe001e165e8b0720b131c2fd77da17b34d2e)