CMake FindPackage(Python) is not preferring Python3

find_package(Python3 COMPONENTS Interpreter REQUIRED) can find python3.

However, when I used find_package(Python COMPONENTS Interpreter REQUIRED), it defaults to use python2 instead of python3 like the documentation indicates it should prefer.

Any ideas?

I’m thinking I found my issue. Elsewhere in my project I had set(Python_EXECUTABLE "/usr/bin/python2.7"). Would this explain why a subsequent find_package(Python) was pointing to python 2 when both where installed?

I believe this was my issue.

If you explicitly set the path to the executable, the find module does not need to search for it anymore.
Python3 works, because it uses Python3_ as prefix for all variables.