For my system (Mac OS X) I had python3. To get it to work, I had do a couple of things
- Run 'brew install --build-from-source -vd --with-python3 boost-python'
- Edit Makefile.config file in the caffe directory
- Edit the PYTHON_LIBRARIES, PYTHON_INCLUDE, PYTHON_LIB variables
- run 'make pycaffe'
Essentially I tell the compiler where to look for the include files, the library files and what specific libraries to use. So to give you examples, in the Makefile.config file, my variables were set to the following:
PYTHON_LIBRARIES := boost_python3 python3.5m
PYTHON_INCLUDE := /usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/include/
python3.5m \
/usr/local/lib/python3.5/site-packages/numpy/core/include
# We need to be able to find libpythonX.X.so or .dylib.
PYTHON_LIB := /usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib
Does this help at all?