简体   繁体   English

YouCompleteMe 不可用:需要使用 Python (3.6.0+) 支持编译的 Vim

[英]YouCompleteMe unavailable: requires Vim compiled with Python (3.6.0+) support

i have vim 8.2.850.我有 vim 8.2.850。 I am trying to install YouCompleteMe.我正在尝试安装 YouCompleteMe。 But get this error, when trying to open vim:但是在尝试打开 vim 时出现此错误:

"YouCompleteMe unavailable: requires Vim compiled with Python (3.6.0+) support"

How can i fix this?我怎样才能解决这个问题? i saw other ppl answer for different versions.我看到其他人对不同版本的回答。 But sorry im a noob, could someone please help and give a detailed explaination on how to fix it?但是对不起,我是菜鸟,有人可以帮忙并详细解释如何修复它吗?

And i am on mac, using terminal我在 Mac 上,使用终端

It is an old question but I wanted to add I simply installed macvim and re-started terminal again.这是一个老问题,但我想补充一点,我只是安装了macvim并再次重新启动了终端。 It solved my problem它解决了我的问题

- brew install macvim 

I'm aware that this isn't directed at your question per say, but I ran into the same issue on Ubuntu with nvim.我知道这不是针对你的问题,但我在 Ubuntu 上使用 nvim 遇到了同样的问题。 Reinstalling didn't help, but adding https://github.com/neovim/pynvim fixed my issue.重新安装没有帮助,但添加https://github.com/neovim/pynvim解决了我的问题。 Perhaps it can be helpful to Mac users using nvim too.也许它对使用 nvim 的 Mac 用户也有帮助。

you can use vim --version | grep python你可以使用vim --version | grep python vim --version | grep python to check your vim. If vim detects the python3, it will show like: vim --version | grep python检查你的 vim。如果 vim 检测到 python3,它将显示如下:

+cmdline_hist      +langmap           -python            +viminfo
+cmdline_info      +libcall           +python3           +virtualedit

The python3 will have a + sign in front of that. python3前面会有一个+号。

If not, first, you must check if you have python3 .如果没有,首先,您必须检查您是否有python3

Second, you need to uninstall vim ( sudo apt purge vim ), then reinstall vim ( sudo apt install vim ).其次,您需要卸载 vim ( sudo apt purge vim ),然后重新安装 vim ( sudo apt install vim )。

Third.第三。 Reconfirmation by vim --version | grep python通过vim --version | grep python再次确认vim --version | grep python . vim --version | grep python

I hope this can help you.我希望这可以帮助你。

Yes, you can reinstall the latest vim version with homebrew: https://formulae.brew.sh/formula/vim是的,您可以使用自制软件重新安装最新的 vim 版本: https://formulae.brew.sh/formula/vim

But, I think you should recheck your vim version with :version , there is no version like yours.但是,我认为你应该用:version重新检查你的 vim 版本,没有像你这样的版本。

And the latest version itself depends on python, and more like nvim.而最新版本本身依赖于 python,更像是 nvim。

# I do like this
brew install vim --HEAD

Confirmed确认的

brew install macvim

worked for me after restarting terminal.重新启动终端后为我工作。 Make sure to确保

brew uninstall vim

before installing macvim, then restart terminal.在安装 macvim 之前,然后重新启动终端。 Solved it for me on new Mac with new apple chip.在带有新苹果芯片的新 Mac 上为我解决了这个问题。

Thankfully, the error message is pretty solid.值得庆幸的是,错误消息非常可靠。 You need vim with Python, Now while I don't personally have a mac that should be as straightforward as making sure you install the correct version.您需要 vim 和 Python,现在虽然我个人没有 Mac,但应该像确保安装正确版本一样简单。

The simplest way is probably going to be with brew as mentioned here .最简单的方法可能是使用这里提到的 brew 。

brew remove vim
brew cleanup
brew install vim --with-python

If you installed it with a binary you will need to find a new binary with python included.如果您使用二进制文件安装它,您将需要找到一个包含 python 的新二进制文件。 Or alternatively you could try and build it from source as the comment from Zoe suggested.或者,您可以尝试按照 Zoe 的建议从源代码构建它。 But I think that may be somewhat more involved than ideal for a beginner, although worthwhile.但是我认为对于初学者来说,这可能比理想的要复杂一些,尽管这是值得的。


It doesn't seem, like this actually involves neovim at all, If it does then you may want to update your question, otherwise it is a good idea to remove the neovim tag.似乎这实际上根本不涉及 neovim,如果确实如此,那么您可能需要更新您的问题,否则最好删除 neovim 标签。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM