第三节 vmi配置python开发环境

参考文章 https://www.jianshu.com/p/297802d16fb4?from=timeline&isappinstalled=0

本章节主是要我安装vim +python3 +YouCompleteMe的过程中问题记录,具体安装过程见参考文章。

配置vim插件 YouCompleteMe失败

1. 没有安装g++

解决方法:yum -y install gcc-c++

2.一开始编译的是python3.6 提示PyByteArray错误。认为可能是需要按python2,所以下了python2.7并安装。

3.重新配置vmi,使vmi同时支持python2和pyhton3

./configure --prefix=/opt/vim8 --enable-fail-if-missing --enable-python3interp --enable-multibyte --enable-fontset --with-features=huge --with-python3-command=/usr/local/bin/python3 --enable-pythoninterp --with-python-command=/usr/bin/python2

4.使用上面命令后出现错误YouCompleteMe unavailable: requires Vim compiled with Python (2.7.1+ or 3.4+) support.

原因:参见https://www.jianshu.com/p/020a2d5d9637

有一个注意点:

Note: If you are using Python, your config directory might have a machine-specific name (e.g. config-3.5m-x86_64-linux-gnu). Check in /usr/lib/python[2/3/3.5] to find yours, and change the python-config-dir and/or python3-config-dir arguments accordingly.

Note for Ubuntu users: You can only use Python 2 or Python 3. If you try to compile vim with both python-config-dir and python3-config-dir, YouCompleteMe will give you an error YouCompleteMe unavailable: requires Vim compiled with Python (2.6+ or 3.3+) support, when you start VIM.

大概就是说用ubuntu的话,只能讲Python2和python3编译一个,不然就会报错,“requires Vim compiled with Python (2.6+ or 3.3+) support”


5.删除了python2软件后,将python编译为动态库后出再问题

ImportError: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory

解决方法:将libpython3.6m.so.1.0拷贝到/lib64目录下

6. 出现新的问题,启动vim报错







重新安装vim

./configure --prefix=/opt/vim8 --enable-fail-if-missing --enable-python3interp --enable-multibyte --enable-fontset --with-features=huge --with-python3-command=/usr/local/bin/python3

解决6 的问题 又出现问题7(!><!)

7. 打开vim后出现新问题

重新安装YouCompleteMe

原来的YouCompleteMe是直接从github上下载下来,依赖没有下,所以重新使用git命令下载

git clone --recursive https://github.com/Valloric/YouCompleteMe.git

下载出错

remote: Counting objects: 34240, done.
remote: Compressing objects: 100% (19/19), done.
error: RPC failed; result=18, HTTP code = 200MiB | 43.00 KiB/s    
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed


解决方法: git config --global https.postBuffer 1048576000 将缓冲区扩大


8.git速度过慢,将https改为http,下行能达到正常的下载速度。

   参见 https://blog.csdn.net/menghuanbeike/article/details/52963514

使用Git下载完成后,直接运行.install.py --all完成安装

9.走了很多弯路:正确的配置路径

  a)安装python3或python2

  b) vim加上Python配置,我用的是python3

      ./configure --prefix=/opt/vim8 --enable-fail-if-missing --enable-python3interp --enable-multibyte --enable-fontset --with-features=huge --with-python3-command=/usr/local/bin/python3

  c)安装bundle

c)到vim的bundle目录下git安装YouCompleteMe

     git clone --recursive http://github.com/Valloric/YouCompleteMe.git  //使用http不要用https,下载速度很快

d) 执行YouCompleteMe目录下的install.py --all









  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值