YouCompleteMe unavailable: module 'collections' has no attribute 'Mapping' - vim

Hi I have been trying to setup YouCompleteMe in vim but it don't work. I am using vim-plug. I tried around 3 different YouCompleteMe repositories but i always got the same error. I am using a Mac os and everything about vim is up to date. I tried adding scripts in .vimrc, running install.py but non of em worked. I really need Help. Here is my .vimrc script and the error

The easiest way to fix the problem is to install youcompleteme in the following way.
In a Terminal, run the command:
$ sudo apt install vim-youcompleteme
Next, run the command:
$ vim-addon-manager install youcompleteme
I got my exactly the same problem fixed a minute ago by running the above two commands, thanks to dominoc925's youcompleteme installation instructions.

Related

Installing Vim with Python3 support?

I installed Vim on my MacBook today (using brew install vim), but I am having a problem: vim --version tells me that there is no Python 3, which I need. I already reinstalled the newest version of Python from their website, then did brew delete vim and brew cleanup and reinstalled Vim, but I'm still having the same problem. Online, I saw the option to use the flag --with-python3 when installing, but when I try that, I get told that this flag doesn't exist. Now I don't know what to do. Do I need to install Python via Homebrew? I also found some people online saying that there are versions of Vim compiled without Python, and that you can compile Vim yourself. Do I need to do that? How?
I should add: I'm very new to this, so if you post your answers or maybe need some more information from me, please explain in detail so I can understand.
I'm a new too.
First, use brew to remove vim you should input brew uninstall vim.Then try to reinstall vim.
For instance, if you wanted to recompile Vim 8 with Python 3 support on Linux, you can try do the following:
$ git clone https://github.com/vim/vim.git
$ cd vim/src
$ ./configure --with-features=huge --enable-python3interp
$ make
$ sudo make install
So,
I include this answer to "Way 0" and "Way 1".
_______________________________________________________________---Way 0 Begin---(:
Way 0:
we should reinstall python3 and VIM,
1.run the below on terminal
brew reinstall python3
the upstairs shows that we reinstall python3 to make sure that needed by VIM.
2.continue run on terminal
brew uninstall vim
the upstairs shows that uninstall vim only if you previously installed it
3.run on terminal
brew install vim
the upstairs shows that reinstall vim via Homebrew
4.run on terminal
4.1 directly use $SHELL command
alias vim=/usr/local/bin/vim
4.2 or bash 's profile(if you use bash as SHELL)
echo 'export PATH="/usr/local/opt/vim/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
4.3 OR zsh configuration file(if you use zsh as SHELL)
edit your zsh configuration file ~/.zshrc via
vim ~/.zshrc
and add the below to TOP line(just use i to enter editing status,
then use ":wq" to quit editing status and save file):
export VIM_HOME=/usr/local/Cellar/vim/8.2.2100/
export PATH=$PATH:$VIM_HOME/bin
and active that config
source ~/.zshrc
(Both 4.1 or 4.2 or 4.3 are the same function.)
the upstairs 4.1/4.2/4.3 shows that we let shell command vim using HomebrewVIM not the defaultVIM.
We know the default VIM functional file is located at /usr/bin/vim,
while homebrew VIM functional file is located at /usr/local/bin/vim;
And default VIM support Python2 with not supporting Python3,
but homebrew VIM support Python3(That's also we needed!).
Let's look at Homebrew VIM:
Homebrew will install VIM vim at /usr/local/Cellar/vim,
create soft link vim under /usr/local/opt,
and Homebrew VIM 's functional file vim is located at /usr/local/bin/vim, also linked to /usr/local/Cellar/vim.
5.exit terminal and restart terminal or even restart mac, input
the below on terminal
vim --version | grep "python3"
checkout whether the symbol bdfore "python3" is + or Not?
"+" means VIM support python3, but "-" Not.
____________________________________________________________---Way 0 END---:)
____________________________________________________---Way 1 Start---(::
Way 1:
First, you need to use this to checkout whether VIM support Python3 or not?
vim --version | grep python
you may see the terminal output liking:
+conceal +linebreak -python3 +visual
as the upstairs shows: that Mac default installed VIM DO NOT SUPPORT Python3.
And that default installed VIM of Mac is not been installed via "brew".
Now, we could not use liking "brew remove" to delate that default installed VIM of Mac,
and it's also why your action
"brew delete vim and brew cleanup and reinstalled Vim"
DO NOT FUNCTION!
Second,
we need to know where that fu-king default installed VIM with not supporting python3,
which vim
output:
/usr/bin/vim
mostly shows like the upstairs(depends default macOS).
Even we use "--with-python3 " to install VIM with supporting
Python3at a long time, but Now Homebrew ONLY recognize "python -V"'s version.
SO we NEED to manually let default python to be python3.
Open your terminal and input:
alias python="python3"
then checkout python that that version whether is python3 or not:
python -V
then, we found that "python -V" shows "Python 3.9.12".
Third,
That's time to use Homebrew to install VIM.
brew install vim
After installing HomebrewVIM, we need to make sure where is HomebrewVIM,
differ from that default installed VIM of Mac:
which vim
output:
/usr/local/bin/vim
Please restart Your Mac, restart Your Terminal and reenter your terminal!!!
Please restart Your Mac, restart Your Terminal and reenter your terminal!!!
Please restart Your Mac, restart Your Terminal and reenter your terminal!!!
then, we need to checkout whether that HomebrewVIM supports Python3 or Not:
vim --version | grep python
output:
+conceal +linebreak +python3 +visual
Successful!
__________________________________________________---Way 1 Terminal---::)
END!

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

i have vim 8.2.850. I am trying to install YouCompleteMe. But get this error, when trying to open 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
It is an old question but I wanted to add I simply installed macvim and re-started terminal again. 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.
Reinstalling didn't help, but adding https://github.com/neovim/pynvim fixed my issue.
Perhaps it can be helpful to Mac users using nvim too.
you can use vim --version | grep python to check your vim. If vim detects the python3, it will show like:
+cmdline_hist +langmap -python +viminfo
+cmdline_info +libcall +python3 +virtualedit
The python3 will have a + sign in front of that.
If not, first, you must check if you have python3.
Second, you need to uninstall vim (sudo apt purge vim), then reinstall vim (sudo apt install vim).
Third. Reconfirmation by 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
But, I think you should recheck your vim version with :version, there is no version like yours.
And the latest version itself depends on python, and more like 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.
Solved it for me on new Mac with new apple chip.
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.
The simplest way is probably going to be with brew as mentioned here.
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. Or alternatively you could try and build it from source as the comment from Zoe suggested. 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.

YouCompleteme unavailable : no module named future

i am trying to install the YouCompleteMe Plugin in vim using Vundle but i get this error message : YouCompleteme unavailable : no module named future
i have vim 7.4.1910 and python 3.5.2 but i don't know if vim was built to support python3
its that your modules are not updated or future module is not found.
to fix this. if you are using ubuntu then first go to
$ cd ~/.vim/bundle/YouCompleteMe && git submodule update --init --recursive
this will update all the modules in youcompleteme
I had the same issue and fixed it by running pip install future. You may have to do this with sudo.

zsh: command not found: mvim

Recently I've installed MacVim and I'm having an issue with run it using iTerm. When I try to run it using the mvim from the iTerm it appeared command not found: mvim. I've tried the solution that provided on this thread but it didn't help. Can anyone please help about this?
Echo the value of your $PATH variable while at your prompt; the mvim file has to be in one of the directories listed there in order to be found when you try to run it.
Either move the mvim script there, or add the directory it is currently located in to your PATH via your .zshrc.
I've got this way:
brew install macvim --override-system-vim --custom-icons --with-cscope --with-lua --enable-pythoninterp --enable-python3interp --ovrride-system-vi --with-python --with-python3
I solved it by this, you may try it:
brew unlink vim
brew link macvim

Vim youcompleteme not working in Debian Jessie

According to this article code completion should work for any language with youcompleteme plugin. I set it up as follows in Debian Jessie:
installed vim from repository
installed youcompleteme from repository
issued 'vam install youcompleteme' in cli
After the last step vim start significantly slower, which means that it is loading the plugin. However, completion does not work.
The output of
$ vam status
Name User Status System Status
editexisting removed removed
justify installed removed
matchit removed removed
youcompleteme installed removed
Is there anything else I have to do to get youcompleteme working?
I contacted the maintainer and finally got the missing hint. As it turns out, all I had left to do was to enable filetype recognition.
In case someone else struggles with this, here are some instructions on how to setup Vim with the Debian package vim-youcompleteme.
Install vim and vim-youcompleteme packages
$ sudo apt-get install vim vim-youcompleteme
This will also install any required dependencies automatically. Afterwards you will have to issue the following command
$ vam install youcompleteme
The last command will create ~/.vim folder in your home folder. However, code completion does not work yet. Some further modifications are required. First copy the default ycm_extra_conf.py file to the newly created ~/.vim/ folder
$ cp /usr/share/doc/vim-youcompleteme/examples/ycm_extra_conf.py ~/.vim/.ycm_extra_conf.py
Then we need to tell vim to use this file for code completion in our .vim.rc and to turn on filetype recognition. The following two lines should be added to ~/.vimrc:
let g:ycm_global_ycm_extra_conf = "~/.vim/.ycm_extra_conf.py"
filetype on
Now vim should be able to use code completion, e.g., with C++ files.
You should follow the installation instructions for YCM, including how to compile it:
Install development tools and CMake: sudo apt-get install
build-essential cmake
Make sure you have Python headers installed: sudo apt-get install
python-dev.
Compiling YCM with semantic support for C-family languages:
cd ~/.vim/bundle/YouCompleteMe ./install.py --clang-completer
Compiling YCM without semantic support for C-family languages:
cd ~/.vim/bundle/YouCompleteMe ./install.py
Also, I would give you the tip to use vim-plug for handling plugins.

Resources