在vim中安装YouCompleteMe时遇到python问题
我已经按照
these instructions,在Vim中安装YouCompleteMe,但是当我发出时:
./install.py --clang-completer 出现以下错误消息: Searching Python 2.7 libraries... ERROR: found static Python library (/usr/local/lib/python2.7/config/libpython2.7.a) but a dynamic one is required. You must use a Python compiled with the --enable-shared flag. If using pyenv,you need to run the command: export PYTHON_CONFIGURE_OPTS="--enable-shared" before installing a Python version. 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/local/lib/python2.7/subprocess.py",line 540,in check_call raise CalledProcessError(retcode,cmd) subprocess.CalledProcessError: Command '['/usr/local/bin/python',u'/home/anmol/.vim/bundle/YouCompleteMe/third_party/ycmd/build.py','--clang-completer']' returned non-zero exit status 1 现在我被困住了,我该怎么办? 解决方法
我检查了YouCompleteMe的构建系统,它使用了一个自定义构建脚本,该脚本使用Python模块distutils来查找Python库和包含目录的路径.您的/usr/local/Python安装可能在官方/ usr安装之前包含在您的PATH变量中,因此运行python可能会运行您的自定义安装,使得distutils返回其目录.
要检查是否为真,请尝试运行哪个python.我假设它会返回类似/usr/local/bin / python的东西. 在这一点上,我看到了几个选项. >尝试运行YCM的安装脚本,指定哪个Python可执行文件应该显式运行:/usr/bin/python ./install.py –clang-completer def FindPythonLibraries(): return ('/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so','/usr/include/python2.7') 请注意,这将使更新YouCompleteMe变得更加困难,因为您必须确保在更新其源时不会覆盖它. 从长远来看,使用官方Python软件包可能会更好. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |