I'm using pybind11 library to create Python bindings for my C++ code.
When I compile my binding code file which includes <pybind11/pybind11.h>, it generates the following error:
/usr/local/include/pybind11/detail/common.h:112:10: fatal error: 'Python.h' file
not found
#include <Python.h>
I could fix this error by changing it to #include <Python/Python.h> but the library uses Python 2.7 to generate bindings.
So I tried changing it to #include "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/include/python3.7m/Python.h" and now the library uses Python 3.7 to generate bindings which is what I want.
Although this method works, I wonder if there's any cleaner way to make the library always include headers from Python3 instead of Python2.
Thank you in advance!
P.S: I'm using macOS 10.15.2