Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on start: Error detected while processing function youcompleteme#Enable..<SNR>80_SetUpPython #1652

Closed
dvinothkumar opened this issue Aug 26, 2015 · 33 comments

Comments

@dvinothkumar
Copy link

I get this error, when starting gvim. This looks very similar to the issue #1281 at #1281. People in that thread reported that doing "git submodule update --init --recursive" fixed the issue. But not for me. I'd appreciate if someone can help me with this.

Error detected while processing function youcompleteme#Enable..80_SetUpPython:
line 34:
Traceback (most recent call last):
Error detected while processing function youcompleteme#Enable..80_SetUpPython:
line 34:
File "", line 25, in
Error detected while processing function youcompleteme#Enable..80_SetUpPython:
line 34:
File "/root/.vim/bundle/YouCompleteMe/autoload/../third_party/ycmd/ycmd/utils.py", line 277, in SafePopen
Error detected while processing function youcompleteme#Enable..80_SetUpPython:
line 34:
return subprocess.Popen( _args, *_kwargs )
Error detected while processing function youcompleteme#Enable..80_SetUpPython:
line 34:
File "/usr/local/lib/python2.7/subprocess.py", line 710, in init
Error detected while processing function youcompleteme#Enable..80_SetUpPython:
line 34:
errread, errwrite)
Error detected while processing function youcompleteme#Enable..80_SetUpPython:
line 34:
File "/usr/local/lib/python2.7/subprocess.py", line 1335, in _execute_child
Error detected while processing function youcompleteme#Enable..80_SetUpPython:
line 34:
raise child_exception
Error detected while processing function youcompleteme#Enable..80_SetUpPython:
line 34:
OSError: [Errno 2] No such file or directory

@micbou
Copy link
Collaborator

micbou commented Aug 26, 2015

Could you check if the file third_party\ycmd\check_core_version.py exists in the YouCompleteMe folder?

@firedev
Copy link

firedev commented Aug 26, 2015

Suddenly it started to produce an error here as well, and I do have this file.

@dvinothkumar
Copy link
Author

Yes, that file exists. I'm still seeing this error.

On Wed, Aug 26, 2015 at 4:12 AM, micbou notifications@github.com wrote:

Could you check if the file third_party\ycmd\check_core_version.py exists
in the YouCompleteMe folder?


Reply to this email directly or view it on GitHub
#1652 (comment)
.

@firedev
Copy link

firedev commented Aug 26, 2015

Recompiling vim fixed that for me.

@dvinothkumar
Copy link
Author

I tried reinstalling vim before. After your response, I tried again. Still
no luck for me.

On Wed, Aug 26, 2015 at 10:38 AM, Nick Ostrovsky notifications@github.com
wrote:

Recompiling vim fixed that for me.


Reply to this email directly or view it on GitHub
#1652 (comment)
.

@dvinothkumar
Copy link
Author

Does anyone have it working with Python 2.7.10? That's the version I have and I was wondering whether it has something to do with my problem.

@oblitum
Copy link
Contributor

oblitum commented Aug 30, 2015

@dvinothkumar my version is this one on OS X, I have no issues.

@oblitum
Copy link
Contributor

oblitum commented Aug 30, 2015

@dvinothkumar I have just built it today from tip by the way.

@firedev
Copy link

firedev commented Aug 30, 2015

@dvinothkumar

$ python --version
Python 2.7.10

Sorry I wish I could help. It just blew up after I came back from lunch, dunno maybe I did brew update prior. So I just did brew uninstall vim && brew install vim and that fixed it.

@willpriceb
Copy link

I too am having a very similar issue (OS X).

  • python - 2.7.10
  • vim - 7.4.873
  • uname -a - Darwin mbp.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64

Loading with Plug - Plug 'Valloric/YouCompleteMe', { 'do': './install.sh --clang-completer' }

Error detected while processing function youcompleteme#Enable..<SNR>190_SetUpPython:
line   34:
Traceback (most recent call last):
Error detected while processing function youcompleteme#Enable..<SNR>190_SetUpPython:
line   34:
  File "<string>", line 25, in <module>
Error detected while processing function youcompleteme#Enable..<SNR>190_SetUpPython:
line   34:
  File "/Users/will/.dotfiles/tag-vim/vim/bundle/YouCompleteMe/autoload/../third_party/ycmd/ycmd/utils.py", line 283, in SafePopen
Error detected while processing function youcompleteme#Enable..<SNR>190_SetUpPython:
line   34:
    return subprocess.Popen( args, **kwargs )
Error detected while processing function youcompleteme#Enable..<SNR>190_SetUpPython:
line   34:
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
Error detected while processing function youcompleteme#Enable..<SNR>190_SetUpPython:
line   34:
    errread, errwrite)
Error detected while processing function youcompleteme#Enable..<SNR>190_SetUpPython:
line   34:
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
Error detected while processing function youcompleteme#Enable..<SNR>190_SetUpPython:
line   34:
    raise child_exception
Error detected while processing function youcompleteme#Enable..<SNR>190_SetUpPython:
line   34:
OSError: [Errno 2] No such file or directory

@puremourning
Copy link
Member

I think it is because the version of python that was built into your Vim no longer exists.
How did you install Vim? How did you install Python?

I recommend using the system Python on OS X, as that is what is tested by our Travis builds.

Also, do you have g:ycm_path_to_python_interpreter set to anything?

@dvinothkumar
Copy link
Author

Thank you. Yes, it was a Python installation issue. Python path was
pointing to the wrong location. Once I fixed it, it worked

On Mon, Oct 5, 2015 at 10:28 AM, Ben Jackson notifications@github.com
wrote:

I think it is because the version of python that was built into your Vim
no longer exists.
How did you install Vim? How did you install Python?

I recommend using the system Python on OS X, as that is what is tested by
our Travis builds.


Reply to this email directly or view it on GitHub
#1652 (comment)
.

@willpriceb
Copy link

I too had g:ycm_path_to_python_interpreter set incorrectly (my arch vars were overriding the OS X ones)

@puremourning
Copy link
Member

I think this is resolved by ensuring your g:ycm_path_to_python_interpreter is a valid path, so closing. If you don't agree this is resolved, please respond in kind.

@4fthawaiian
Copy link

can anyone point out how to check that value?

@thismyname
Copy link

anyone?

@puremourning
Copy link
Member

Run :echo g:ycm_path_to_python_interpreter

@thismyname
Copy link

I get blank..nothing.. what it should be?

@micbou
Copy link
Collaborator

micbou commented Dec 8, 2015

Type this command in Vim:

:echo pyeval( 'paths.PathToPythonInterpreter()' )

and check if the Python path returned by this command is the right one. If not, set the variable g:ycm_path_to_python_interpreter to the correct path in your vimrc file.

@MatrixManAtYrService
Copy link

micbou's suggestion fixed this for me:

" Fix Python Path (for YCM)
let g:ycm_path_to_python_interpreter="/usr/bin/python"

@naveenpanwar
Copy link

#1652 (comment) no I don't see a file with that name inside that folder, I installed a fresh copy of vim and pulled latest changes from the YouCompleteMe repo, I compiled with clang support.

I get the error
/usr/bin/python: can't open file '/home/naveen/Dropbox/dotfiles/vim/bundle/YouCompleteMe/python/ycm/../../third_party/ycmd/check_core_version.py': [Errno 2] No such file or directory

when I execute gvim command from command line

screenshot from 2016-02-23 16-42-32

And the errors in vim as shown in attachment image.

@vheon
Copy link
Contributor

vheon commented Feb 23, 2016

@naveenpanwar is the file really there? what reading right does it have? can be read in vim?

In short:

  • the output of
ls -l /home/naveen/Dropbox/dotfiles/vim/bundle/YouCompleteMe/python/ycm/../../third_party/ycmd/check_core_version.py
  • in vim
echo filereadable('/home/naveen/Dropbox/dotfiles/vim/bundle/YouCompleteMe/python/ycm/../../third_party/ycmd/check_core_version.py')```

@suiyuan2009
Copy link

I meet the problem on Ubuntu 16.04, I reinstall vim from source solve the problem.

@charlemana
Copy link

Running ./install.sh inside the ~/.vim/bundle/YouCompleteMe folder fixed my problems.

@emil2k
Copy link

emil2k commented Dec 20, 2016

Uninstalling and installing vim from source with brew fixed it for me:

brew uninstall vim
brew install -s vim

@joaquinalcerro
Copy link

I solved my problem following this thread and adding:

let g:ycm_path_to_python_interpreter="/usr/local/bin/python"

in my .vimrc file.

Thanks to all.

@silenter-su
Copy link

Thank you joaquinalcerro. you are right.

@s-taylor
Copy link

+1 to setting g:ycm_path_to_python_interpreter, just check your python path first with which python

@bevinhex
Copy link

If I set that variable to /usr/bin/python, I was getting same error, for me the problem was default python in my ubuntu16.04 was python2.7, fixed it by setting the g:ycm_path_to_python_interpreter variable to /usr/bin/python3

@JiaoZiLang
Copy link

I solve this problem also. I think just python path error.

@huangzonghao
Copy link

I encountered the same problem. But I remembered that I rewrap the python packages with brew some how and then the problem occurred. So a straightforward thought is that it is the path that caused the problem. A simple fix is to re-compile your vim. I did so and dang, the problem solved.

@dengbzh
Copy link

dengbzh commented Aug 31, 2018

let g:ycm_path_to_python_interpreter="/usr/bin/python" that's works for me!

@micbou
Copy link
Collaborator

micbou commented Aug 31, 2018

Most answers in that thread are outdated or unhelpful. Firstly, the g:ycm_path_to_python_interpreter option is deprecated and g:ycm_server_python_interpreter should be used instead. Secondly, suggesting to set this option to some Python interpreter path cannot be the solution for everyone. It depends on how the YCM library was compiled. If the install.py script has been used, setting this option should never be needed as YCM will find the right Python interpreter by reading the file YouCompleteMe/third_party/ycmd/PYTHON_USED_DURING_BUILDING generated by the script. If the full installation instructions has been followed and the server does crash at Vim startup, it may be needed to set this option to the Python used to build the YCM library. Said that, if you are really seeing the message Error detected while processing function youcompleteme#Enable..<SNR>80_SetUpPython at startup, you should raise a new issue (please follow the issue template if you do) so that we can figure it out. Locking the issue.

@ycm-core ycm-core locked and limited conversation to collaborators Aug 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests