我可以在 Python 中导入 pybind11,它位于包含路径中。但是,按照此处的说明,我收到以下错误:
(venv)[jalal@ivcgpu1 affdex-sdk-py]$ python
Python 2.7.5 (default, Aug 4 2017, 00:39:18)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pybind11
>>> pybind11.get_include()
'/home/grad3/jalal/venv/include/site/python2.7'
>>> pybind11.get_include(True)
'/home/grad3/jalal/venv/include/site/python2.7'
>>> quit()
(venv)[jalal@ivcgpu1 affdex-sdk-py]$ c++ -O3 -shared -std=c++11 -fPIC -Wl,--no-as-needed -I$AFFDEX_SDK_HOME/include -I$HOME/venv/include/site/python2.7 `python-config --cflags --ldflags --libs` -Wl,--no-as-needed -laffdex-native -L$AFFDEX_SDK_HOME/lib affdex.cpp -o affdex.so
affdex.cpp:9:31: fatal error: pybind11/pybind11.h: No such file or directory
#include <pybind11/pybind11.h>
^
compilation terminated.
(venv)[jalal@ivcgpu1 affdex-sdk-py]$
我该如何解决这个错误?
更新:
(venv)[jalal@ivcgpu1 affdex-sdk-py]$ echo $HOME
/home/grad3/jalal
(venv)[jalal@ivcgpu1 affdex-sdk-py]$ echo $HOME/venv/include/site/python2.7
/home/grad3/jalal/venv/include/site/python2.7