codota / tabnine-vim

Vim client for TabNine. https://vimawesome.com/plugin/tabnine-vim
https://www.tabnine.com/install/vim
GNU General Public License v3.0
669 stars 36 forks source link

Broken on python 3.10 #103

Closed WiSaGaN closed 2 years ago

WiSaGaN commented 2 years ago

Issue Details: After upgrade to Fedora 35, opening vim results in below error in status line:

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

I suspect it is because Fedora 35 upgrades Python from 3.9 to 3.10 I can't seem to get TabNine::config running in vim.

gz#9894

bilucodota commented 2 years ago

did you try our new fork? https://github.com/tabnine/YouCompleteMe

WiSaGaN commented 2 years ago

did you try our new fork? https://github.com/tabnine/YouCompleteMe

No. Can you elaborate why that is relavent to this issue?

bilucodota commented 2 years ago

The new fork is updated more frequently and thus expected to work better on newer installations.

luoleicn commented 2 years ago

did you try our new fork? https://github.com/tabnine/YouCompleteMe

No. Can you elaborate why that is relavent to this issue?

have you solved this problem?

bilucodota commented 2 years ago

@WiSaGaN @luoleicn we've added python3 support on this branch: https://github.com/codota/tabnine-vim/tree/python3

WiSaGaN commented 2 years ago

Thanks @bilucodota . This now works for me. Please feel free to close this when you see fit.

bilucodota commented 2 years ago

Keep us posted!

luoleicn commented 2 years ago

@bilucodota Thank you, but python3 branch doesnot work either, still "YouCompleteMe unavailable: module 'collections' has no attribute 'Mapping'"

luoleicn commented 2 years ago

and my evn is Python 3.7.3, VIM - Vi IMproved 8.2, macOS 12.1

bilucodota commented 2 years ago

Hi @luoleicn can you share the status of git show as well as the output of :messages ? One again - I would definitely recommend that you switch to our latest YCM fork https://github.com/tabnine/YouCompleteMe

luoleicn commented 2 years ago

@bilucodota thanks, I moved to https://github.com/tabnine/YouCompleteMe, but still not working:(, :message said:

The ycmd server SHUT DOWN (restart with ':YcmRestartServer'). Unexpected exit code -6. Type ':YcmToggleLogs ycmd_60335_stderr_3zwquq7b.log' to check th

I check ycmd_60335_stderr_3zwquq7b.log No global extra conf, not calling method YcmCorePreload

bilucodota commented 2 years ago

did you follow the installation instructions? https://github.com/tabnine/YouCompleteMe#installation

luoleicn commented 2 years ago

@bilucodota Thanks again, I change my default python from miniconda3 to homebrew, it works for me now, although i dont know why

bilucodota commented 2 years ago

great!

schrotie commented 2 years ago

Hi @bilucodota , I just ran into the same problem, apparently after my Manjaro (arch) updated python. python: 3.10.1 vim: 8.2.4106

I'm not using pathogen, vundle or some such thing but the built-in native package loading of vim 8.

As recommended here I installed https://github.com/tabnine/YouCompleteMe (in ~/.vim/pack/schrotie/start/YouCompleteMe and did python3 install.py --all there) successfully.

I also switched ~/.vim/pack/schrotie/start/tabnine-vim to the python3 branch. I tried calling the install script there. install.sh says it's deprecated and complains that urllib3 is missing (which is installed). python3 install.py fails with:

Traceback (most recent call last):
  File "/home/schrotie/.vim/pack/schrotie/start/tabnine-vim/third_party/ycmd/build.py", line 50, in <module>
    import requests
  File "/home/schrotie/.vim/pack/schrotie/start/tabnine-vim/third_party/ycmd/third_party/requests/requests/__init__.py", line 134, in <module>
    from . import packages
ImportError: bad magic number in 'requests.packages': b'\x03\xf3\r\n'

When I then start vim I get a ton of errors. However, I'm not sure if it prints all problems ... there's quite some traces. Some are:

AttributeError: type object 'BaseRequest' has no attribute 'session'. Did you mean: 'Session'?
ImportError: bad magic number in 'requests.packages': [...]
E858: Eval did not return a valid python object

Do you have any suggestions?

schrotie commented 2 years ago

The issue was solved for me by bilucodata. See issue 107.