Contrary to the docs at https://cmake.org/cmake/help/latest/module/FindPythonLibs.html, src/python/python3/CMakeLists.txt calls find_package(PythonLibs 3) prior to calling find_package(PythonInterp 3), resulting in the wrong python libraries being used when using a non-default version of python. Reversing the order of the lines in the file fixes the issue.