Python in gradle is using wrong python - it doesn't respect the PATH variable
it should be possible to prefix all python calls with `env` call
Yup, it works!
It seems that only PATH variable is affected.
Oki problem is in Gradle daemon.
If Gradle is invoked, by default, it creates a new daemon which is used to invoke any following builds. However, the daemon inherits environment of parent process at launch time. Hence, all our exec tasks inherits the same environment. At the end it means that if you change Python profile (via virtualenv or Conda), then it is not accepted. See following experiment:
The workaround is to kill/not use gradle daemon or specify Python executable via a property.
Exec task should honor setting of PATH (inhering from parent env).
But in some cases people have binaries `python`, `python2` and `python3` and `python` is just a symlink/alias to `python2`, which causes problems as well...
my idea for the solution is to check PATH variable and pick the first python. This way we don't have to introduce new variable