From f600c1d8992e4708e43fe7dd3c97a0a47657cdad Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Fri, 3 Jun 2016 14:47:54 +0200 Subject: [PATCH] updated FAQ section on Python detection --- docs/faq.rst | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/docs/faq.rst b/docs/faq.rst index b6c91a8bd..788b3b893 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -24,24 +24,17 @@ The Python interpreter immediately crashes when importing my module See item 2 of the first answer. -CMake doesn't detect the right Python version, or it finds mismatched interpreter and library versions -====================================================================================================== +CMake doesn't detect the right Python version +============================================= -The Python detection logic of CMake is flawed and can sometimes fail to find -the desired Python version, or it chooses mismatched interpreter and library -versions. A longer discussion is available on the pybind11 issue tracker -[#f1]_, though this is ultimately not a pybind11 issue. - -To force the build system to choose a particular version, delete CMakeCache.txt -and then invoke CMake as follows: +The CMake-based build system will try to automatically detect the installed +version of Python and link against that. When this fails, or when there are +multiple versions of Python and it finds the wrong one, delete +``CMakeCache.txt`` and then invoke CMake as follows: .. code-block:: bash - cmake -DPYTHON_EXECUTABLE:FILEPATH=<...> \ - -DPYTHON_LIBRARY:FILEPATH=<...> \ - -DPYTHON_INCLUDE_DIR:PATH=<...> . - -.. [#f1] http://github.com/pybind/pybind11/issues/99 + cmake -DPYTHON_EXECUTABLE:FILEPATH= . Limitations involving reference arguments =========================================