Open hakonhagland opened 4 years ago
This pretty much always finds the wrong interpreter for me, it's just a light helper on top of FindPythonLibs/Interp that favors Python 3, which were abandoned by CMake because they has so many problems.
I am working on #2156 , but until then, the canonical command is:
cmake .. -DPYTHON_EXECUTABLE=$(which python)
I created a simple test module
example/example.cpp
using thepybind11
library, then to compile it I usedCMakeLists.txt
:then created a
build
folder, and rancmake
:The output is:
I am using
pyenv
with the following versions installed:Notice that
pybind11Tools.cmake
finds the version3.8.0
even though the current is set to3.7.3
. If I shift to version3.8.0
it runs fine: