I have been trying to install YouCompleteMe
for a long time. At first, I failed because I need to build Vim
having python support. Now I have it solved, but I always fail at building YouCompleteMe
itself because of various kinds of problems (if you guys want to help me on this, that's okay too :-)). The build log of YouCompleteMe
is this (using only ./install.py
):
./install.py
-- The C compiler identification is GNU 5.3.1
...... Successful Detects ......
-- Detecting CXX compile features - done
Your C++ compiler supports C++11, compiling in that mode.
-- Found PythonLibs: /usr/local/lib/libpython2.7.a (found suitable version "2.7.10", minimum required is "2.6")
-- Found PythonInterp: /usr/local/bin/python2 (found suitable version "2.7.10", minimum required is "2.6")
NOT using libclang, no semantic completion for C/C++/ObjC will be available
-- Found PythonInterp: /usr/local/bin/python2 (found version "2.7.10")
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/ycm_build.jmI4vO
Scanning dependencies of target BoostParts
[ 0%] [ 2%] [ 2%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/atomic/src/lockpool.cpp.o
...... Successfully Builds ......
[ 92%] Building CXX object ycm/CMakeFiles/ycm_client_support.dir/PythonSupport.cpp.o
In file included from /home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/BoostParts/boost/type_traits/ice.hpp:15:0,
from /home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/BoostParts/boost/python/detail/def_helper.hpp:9,
from /home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/BoostParts/boost/python/class.hpp:29,
from /home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/BoostParts/boost/python.hpp:18,
from /home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/PythonSupport.h:21,
from /home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/ycm_client_support.cpp:19:
/home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/BoostParts/boost/type_traits/detail/ice_or.hpp:17:71: note: #pragma message: NOTE: Use of this header (ice_or.hpp) is deprecated
# pragma message("NOTE: Use of this header (ice_or.hpp) is deprecated")
^
...... Some similar messages ......
In file included from /home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/BoostParts/boost/type_traits/ice.hpp:18:0,
from /home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/BoostParts/boost/python/detail/def_helper.hpp:9,
from /home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/BoostParts/boost/python/class.hpp:29,
from /home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/BoostParts/boost/python.hpp:18,
from /home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/PythonSupport.h:21,
from /home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/ycm_core.cpp:19:
/home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/BoostParts/boost/type_traits/detail/ice_eq.hpp:17:71: note: #pragma message: NOTE: Use of this header (ice_eq.hpp) is deprecated
# pragma message("NOTE: Use of this header (ice_eq.hpp) is deprecated")
^
[ 96%] Building CXX object ycm/CMakeFiles/ycm_client_support.dir/CustomAssert.cpp.o
[ 97%] Building CXX object ycm/CMakeFiles/ycm_client_support.dir/Result.cpp.o
[ 98%] [100%] Building CXX object ycm/CMakeFiles/ycm_core.dir/CustomAssert.cpp.o
Building CXX object ycm/CMakeFiles/ycm_core.dir/Result.cpp.o
Linking CXX shared library /home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/ycm_client_support.so
/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpython2.7.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
ycm/CMakeFiles/ycm_client_support.dir/build.make:387: recipe for target '/home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/ycm_client_support.so' failed
make[3]: *** [/home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/ycm_client_support.so] Error 1
CMakeFiles/Makefile2:130: recipe for target 'ycm/CMakeFiles/ycm_client_support.dir/all' failed
make[2]: *** [ycm/CMakeFiles/ycm_client_support.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
Linking CXX shared library /home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/ycm_core.so
/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpython2.7.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
ycm/CMakeFiles/ycm_core.dir/build.make:387: recipe for target '/home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/ycm_core.so' failed
make[3]: *** [/home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/ycm_core.so] Error 1
CMakeFiles/Makefile2:165: recipe for target 'ycm/CMakeFiles/ycm_core.dir/all' failed
make[2]: *** [ycm/CMakeFiles/ycm_core.dir/all] Error 2
CMakeFiles/Makefile2:209: recipe for target 'ycm/CMakeFiles/ycm_support_libs.dir/rule' failed
make[1]: *** [ycm/CMakeFiles/ycm_support_libs.dir/rule] Error 2
Makefile:148: recipe for target 'ycm_support_libs' failed
make: *** [ycm_support_libs] Error 2
Traceback (most recent call last):
File "/home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/build.py", line 372, in <module>
Main()
File "/home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/build.py", line 361, in Main
BuildYcmdLibs( args )
File "/home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/build.py", line 275, in BuildYcmdLibs
subprocess.check_call( build_command )
File "/usr/local/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--target', 'ycm_support_libs', '--', '-j', '4']' returned non-zero exit status 2
Traceback (most recent call last):
File "./install.py", line 32, in <module>
Main()
File "./install.py", line 21, in Main
subprocess.check_call( [ python_binary, build_file ] + sys.argv[1:] )
File "/usr/local/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/local/bin/python', '/home/bunny/.vim/bundle/YouCompleteMe/third_party/ycmd/build.py']' returned non-zero exit status 1
. So I install the package vim-youcompleteme
by apt
successfully. So how can I use YouCompleteMe
now?
EDIT: I used vam
to install YouCompleteMe
, no problem, but when I open vi
, it gives me this error:
Error detected while processing function youcompleteme#Enable.. <SNR>30_SetUpPython:
line 29:
Traceback (most recent call last):
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>30_SetUpPython:
line 29:
File "<string>", line 25, in <module>
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>30_SetUpPython:
line 29:
File "/usr/share/vim-youcompleteme/python/ycm/youcompleteme.py", line 34, in <module>
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>30_SetUpPython:
line 29:
from ycm.client.ycmd_keepalive import YcmdKeepalive
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>30_SetUpPython:
line 29:
File "/usr/share/vim-youcompleteme/python/ycm/client/ycmd_keepalive.py", line 22, in <module>
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>30_SetUpPython:
line 29:
from ycm.client.base_request import BaseRequest
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>30_SetUpPython:
line 29:
File "/usr/share/vim-youcompleteme/python/ycm/client/base_request.py", line 20, in <module>
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>30_SetUpPython:
line 29:
import requests
Press ENTER or type command to continue
Error detected while processing function youcompleteme#Enable..<SNR>30_SetUpPython:
line 29:
ImportError: No module named requests
Press ENTER or type command to continue