Building YCM on Ubuntu 14.04: Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DI

2,398 views
Skip to first unread message

Thomas Upton

unread,
Sep 6, 2014, 11:47:56 AM9/6/14
to ycm-...@googlegroups.com
```
❯ ./install.sh
/tmp/ycm_build.mMJcpr ~/.vim/bundle/YouCompleteMe
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is Clang 3.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
Your C++ compiler supports C++11, compiling in that mode.
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 "2.6")
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)
  BoostParts/CMakeLists.txt:30 (find_package)


-- Configuring incomplete, errors occurred!
See also "/tmp/ycm_build.mMJcpr/CMakeFiles/CMakeOutput.log".
```

Googling about the above errors gives me reason to think that CMake can't find architecture-specific Python libs, but I could be completely mistaken.

Has anyone seen this issue before? I tried searching issues both in the YCM github and here in this user group, but I couldn't find anything relevant.

Neil Han

unread,
Oct 29, 2014, 1:45:33 AM10/29/14
to ycm-...@googlegroups.com
I had similar issue with ubuntu 14.04. The host is missing python-dev or python3-dev package.

You can try this: 
sudo apt-get install python-dev python3-dev

Konrad Tallman

unread,
Mar 2, 2015, 7:20:40 PM3/2/15
to ycm-...@googlegroups.com
THANKS! This worked for me!

Kevin Blansit

unread,
Sep 19, 2015, 4:34:09 PM9/19/15
to ycm-users
I understand that either using atp-get or yum install the python-dev typically works to fix this, but I was wondering how to do so without root access. I'm currently on a cluster linux server without any access to root or sudo abilities. 

Kevin Blansit

unread,
Sep 19, 2015, 6:21:53 PM9/19/15
to ycm-users
I found out that I had to manually specify my python libraries in a similar way to as follows: 

-DPYTHON_INCLUDE_DIR=/work/miniconda/include/python2.7/ \
-DPATH_TO_LLVM_ROOT=~/ycm_build/llvm_root_dir \

Edward Li

unread,
Oct 1, 2015, 9:42:16 PM10/1/15
to ycm-users
I found the same issue...

Erich Foster

unread,
Nov 4, 2016, 9:51:01 PM11/4/16
to ycm-users
I too had this issue and the way I discovered I could solve it was by setting PYTHON_LIBRARY and PYTHON_INCLUDE then doing the following
export EXTRA_CMAKE_ARGS='-DPYTHON_INCLUDE_DIR=<LOCATION_OF_PYTHON_INCLUDE> -DPYTHON_LIBRARY=<LOCATION_OF_PYTHON_LIB>'
./install.py --clang-completer
Reply all
Reply to author
Forward
0 new messages