[Fix] virtualenv python interpreter used #98
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In a recent struggle with clearml-agent, I discovered an odd edge case, leading to this PR.
In my case, there are 4 different Python interpreters on the system - 2.7, 3.6.9, 3.7.5, and 3.8. For Python 3.6.9 and Python 3.8, the
virtualenv
in question was either most up to date or relatively up to date. For Python 3.7.5 it was extremely outdated.Then, when a user had requested to use Python 3.7.5, the agent would correctly identify the executable (
python3.7
) and runpython3.7 -m virtualenv <path>
. For some reason, the old install ofvirtualenv
consistently usedpython2
as the underlying executable, and any task would then crash.Finding the source for this bug required a deeper dive into
clearml-agent
code, and I believe simple logging of the virtualenv version used would've been useful.Finally, the use of
--python <python interpreter>
would've worked just as well, forcingvirtualenv
to use the specific interpreter (which should be the default, but apparently it was not).Hence this PR:
virtualenv
version usingpythonx.y -m virtualenv --version
--python
flag