Fixes #516, this switches to a more robust way to detect if we are inside of a virtual env or not