Ubuntu – CMake can not find PythonLibs

cmake

I am trying to build inria Graphite on my ubuntu which is running in a VirtualBox simulator, I follow the instructions, and install the python-dev packages, but when I run cmake , still got an error:

CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108          (message):
Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
(Required is at least version "3.2")
Call Stack (most recent call first):
 /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:315     (_FPHSA_FAILURE_MESSAGE)
 /usr/share/cmake-2.8/Modules/FindPythonLibs.cmake:208 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
 src/packages/OGF/gel_python3/CMakeLists.txt:11 (FIND_PACKAGE)

I checked the /usr/lib/ and find

tintin@tintin-VirtualBox:/usr/lib$ find . -name "libpython*"
./x86_64-linux-gnu/libpython3.4m.so.1.0
./x86_64-linux-gnu/libpython2.7.so.1.0
./x86_64-linux-gnu/libpython3.4m.a
./x86_64-linux-gnu/libpython2.7.a
./x86_64-linux-gnu/libpython3.4m.so
./x86_64-linux-gnu/libpython2.7.so
./x86_64-linux-gnu/libpython2.7.so.1
./x86_64-linux-gnu/libpython3.4m.so.1

so why cmake can not find the PythonLibs, or how should I deal with this?

Best Answer

Installing python-dev actually fixed this for me:

sudo apt-get install python-dev

Got the hint here: https://github.com/Valloric/YouCompleteMe/issues/484

Related Question