vim --version
.:YcmDebugInfo
.:YcmToggleLogs stderr
.Thank you for adhering to this process! It ensures your issue is resolved
quickly and that neither your nor our time is needlessly wasted.
It said cant find pyconfig.h, I searched it in my environment
# root @ iZ28y724trcZ in ~/.vim/bundle/YouCompleteMe on git:master o [10:14:15] C:1
$ grep -r pyconfig.h *
third_party/ycmd/cpp/BoostParts/boost/python/detail/wrap_python.hpp: // system headers used by pyconfig.h right here.
third_party/ycmd/cpp/BoostParts/boost/python/detail/wrap_python.hpp:# include <pyconfig.h>
third_party/ycmd/cpp/BoostParts/boost/python/detail/python22_fixed.h:#include "pyconfig.h"
third_party/ycmd/cpp/BoostParts/boost/python/detail/python22_fixed.h:/* pyconfig.h may or may not define DL_IMPORT */
followings are message after I exec ./install.py --clang-complier
Build files have been written to: /tmp/ycm_build.DdIYe1
Scanning dependencies of target BoostParts
[ 0%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/str.cpp.o
In file included from /root/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/BoostParts/boost/python/detail/prefix.hpp:13:0,
from /root/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/BoostParts/boost/python/str.hpp:8,
from /root/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/BoostParts/libs/python/src/str.cpp:4:
/root/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/BoostParts/boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or directory
# include <pyconfig.h>
^
compilation terminated.
gmake[3]: *** [BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/str.cpp.o] Error 1
gmake[2]: *** [BoostParts/CMakeFiles/BoostParts.dir/all] Error 2
gmake[1]: *** [ycm/CMakeFiles/ycm_core.dir/rule] Error 2
gmake: *** [ycm_core] Error 2
Traceback (most recent call last):
File "/root/.vim/bundle/YouCompleteMe/third_party/ycmd/build.py", line 480, in <module>
Main()
File "/root/.vim/bundle/YouCompleteMe/third_party/ycmd/build.py", line 467, in Main
BuildYcmdLib( args )
File "/root/.vim/bundle/YouCompleteMe/third_party/ycmd/build.py", line 369, in BuildYcmdLib
subprocess.check_call( build_command )
File "/usr/lib64/python2.7/subprocess.py", line 542, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--target', 'ycm_core', '--', '-j', '1']' returned non-zero exit status 2
Traceback (most recent call last):
File "./install.py", line 44, in <module>
Main()
File "./install.py", line 33, in Main
subprocess.check_call( [ python_binary, build_file ] + sys.argv[1:] )
File "/usr/lib64/python2.7/subprocess.py", line 542, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/local/bin/python', u'/root/.vim/bundle/YouCompleteMe/third_party/ycmd/build.py', '--clang-completer']' returned non-zero exit status 1
Looks like you don't have the Python headers on your machine. On which OS are you?
Hi, My OS is CentOS 7.0 and my vim is 7.4 and suport python
Could you paste the output of the first 3 lines from the install.py
script?
#!/usr/bin/env python
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from __future__ import absolute_import
import os
import subprocess
import sys
import os.path as p
import glob
Sorry, I was not clear. I meant the output from the ./install.py --clang-completer
command. It should be something like:
Searching Python 3.5 libraries...
Found Python library: C:\Python35\libs\python35.lib
Found Python headers folder: C:\Python35\include
./install.py --clang-completer
Searching Python 2.7 libraries...
Found Python library: /usr/lib64/libpython2.7.so.1.0
Found Python headers folder: /usr/include/python2.7
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/cc
I am not a CentOS expert but your issue should be fixed by installing the python-devel
package:
yum install python-devel
and running again the ./install.py
script.
10%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object/life_support.cpp.o
[ 10%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object/stl_iterator.cpp.o
[ 11%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object/pickle_support.cpp.o
[ 12%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/numeric.cpp.o
Great. I am closing the issue then.
Ubuntu version:
apt-get install python-dev
I check the install.sh 12 PYTHON_BINARY=python
13 if command_exists python2; then
14 PYTHON_BINARY=python2
15 echo "python2"
16 fi
and i find there exist Python2 and Python3 meanwhile。And it would execute python2. So I change python2 to python3 and if fixed.
13 if command_exists python2; then
14 PYTHON_BINARY=python2
15 echo "python3"
16 fi
You should be using install.py
, not install.sh
.
Most helpful comment
I am not a CentOS expert but your issue should be fixed by installing the
python-devel
package:and running again the
./install.py
script.