On 21/08/2023 20:01, Christian Huitema wrote:
The workaround of adding packages specifically to python3.10 worked. I noticed that the cmake output contained:
-- Found Python3: /opt/homebrew/Frameworks/Python.framework/Versions/3.10/bin/python3.10 (found version "3.10.12") found components: Interpreter
I supposed that cmake includes a script to find the latest available version number, and then directs make to use that version, python3.10. That might explain the issue.
Oh. So yes, CMake (more precisely, its find_package command, or maybe specifically about the Python3 package). Experimenting a bit, it seems to traverse $PATH directories in order and take a python3 version in the first $PATH directory that has one. I don't understand how it decides which version when the first directory has more than one: experimentally it isn't the highest version.
I think our goal in CMake was to allow it to find either `python3` or `python`. (Or quite possibly `python2` or `python` at the time we originally wrote this.) It's confusing that it doesn't find the default `python3`! The way we're using CMake seems plausible though, so this looks like a bug or bad design in CMake.
Putting /opt/homebrew/Frameworks/Python.framework/Versions/3.10/bin after /usr/bin in $PATH should resolve this and should generally not matter otherwise, but I don't know if that's easy to arrange (depends how you set up your $PATH).
Best regards,