vim安装插件YouCompleteMe出错动态库链接问题

1. 问题
使用vim安装代码自动补全插件时遇到要求Python版本>3.5,从官网源码安装后,安装
YouCompleteMe时出现动态库问题,显示如下

txt@txt-CN15S:~/.vim/bundle/YouCompleteMe$ ./install.sh 
WARNING: this script is deprecated. Use the install.py script instead.
Searching Python 3.6 libraries...
ERROR: found static Python library (/usr/local/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.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.

2.解决方案
原因:YouCompleteMe安装文件自动定位动态库错误.
修改:自动添加替换动态库查找函数
手动将 /third_party/ycmd/build.py 内的FindPythonLibraries()函数替换为以下内容,其中返回的是自己版本的Python动态库.

def FindPythonLibraries():
	return ('/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6.so', '/usr/include/python3.6') 

3.结果
安装成功,第四行第5行显示找到

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值