mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 14:45:12 +00:00
updated FAQ section on Python detection
This commit is contained in:
parent
ca8dc08a66
commit
f600c1d899
21
docs/faq.rst
21
docs/faq.rst
@ -24,24 +24,17 @@ The Python interpreter immediately crashes when importing my module
|
|||||||
|
|
||||||
See item 2 of the first answer.
|
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 CMake-based build system will try to automatically detect the installed
|
||||||
the desired Python version, or it chooses mismatched interpreter and library
|
version of Python and link against that. When this fails, or when there are
|
||||||
versions. A longer discussion is available on the pybind11 issue tracker
|
multiple versions of Python and it finds the wrong one, delete
|
||||||
[#f1]_, though this is ultimately not a pybind11 issue.
|
``CMakeCache.txt`` and then invoke CMake as follows:
|
||||||
|
|
||||||
To force the build system to choose a particular version, delete CMakeCache.txt
|
|
||||||
and then invoke CMake as follows:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
cmake -DPYTHON_EXECUTABLE:FILEPATH=<...> \
|
cmake -DPYTHON_EXECUTABLE:FILEPATH=<path-to-python-executable> .
|
||||||
-DPYTHON_LIBRARY:FILEPATH=<...> \
|
|
||||||
-DPYTHON_INCLUDE_DIR:PATH=<...> .
|
|
||||||
|
|
||||||
.. [#f1] http://github.com/pybind/pybind11/issues/99
|
|
||||||
|
|
||||||
Limitations involving reference arguments
|
Limitations involving reference arguments
|
||||||
=========================================
|
=========================================
|
||||||
|
Loading…
Reference in New Issue
Block a user