Python in gradle is using wrong python - it doesn't respect the PATH variable

Description

None

Activity

Show:
Jakub Hava
April 7, 2017, 10:50 AM
Edited

Michal:
it should be possible to prefix all python calls with `env` call

Yup, it works!

Michal Malohlava
April 7, 2017, 2:18 AM

It seems that only PATH variable is affected.

Michal Malohlava
April 7, 2017, 2:06 AM

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.

Michal Malohlava
April 7, 2017, 1:57 AM

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...

Jakub Hava
April 6, 2017, 2:27 PM
Edited

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

Fixed

Assignee

Jakub Hava

Reporter

Jakub Hava

Labels

None

CustomerVisible

No

testcase 1

None

testcase 2

None

testcase 3

None

h2ostream link

None

Affected Spark version

None

AffectedContact

None

AffectedCustomers

None

AffectedPilots

None

AffectedOpenSource

None

Support Assessment

None

Customer Request Type

None

Support ticket URL

None

End date

None

Baseline start date

None

Baseline end date

None

Task progress

None

Task mode

None

ReleaseNotesHidden

None

Fix versions

Priority

Major