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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this look for an executable called
python
? That won't work on most systems, aspython
is usually Python 2.I still get Python 3.4 on my system, even though I have 3.6 and 3.7 as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
It still works, this is only one piece in the "find python" machinery.
What is the output of "which python", and "which python3" on your system? (And what is the versions of these outputs?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here's what CMake says:
That's what gets used too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, I guess we should have python3 take priority over python3.4.
But I'm a bit busy at the moment, so I don't have time to implement this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://virtualenv.pypa.io/en/latest/userguide/?highlight=activate#activate-script
https://virtualenv.pypa.io/en/latest/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree to document it but disagree to use the latest. We can always specify what to use with
-DPYTHON_EXECUTABLE
. The default should be latest stable interpreter, which is whateverpython3
points to. Or at least that's what I thought.CMake version 3.12 introduced
FindPython
which seems to find Python 3.7 even if my python3 points to 3.6. 🤔 If we are going to useFindPython
when we require new version of CMake, it might be better to behave the same way?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, let's deal with that question when we get there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels a bit magic to me to assume that whatever
python3
points to is what's intended to be used. Always use latest is super simple, and it's backwards compatible.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to be the priority:
'python'
'python3'
'python3.x'
This makes sense to me. Is simple to understand, and meets the requirements described in: #11857