-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
YouCompleteMe and pyenv #759
Comments
Please see CONTRIBUTING.md. |
Not sure why this was closed as pyenv is gaining quite a bit of popularity... Anyway, for posterity's sake, I'll share how I resolved this issue:
Note that this still leaves the use case of pyenv + YouCompleteMe unattainable, so again, I'm not sure why this issue was closed. |
Just to follow up: looks like you can't install Homebrew's Python, as I get continual YCM errors upon start up. I wish there were some documentation on how to correctly link Homebrew's Python to work with both Vim and YCM, but until that happens, I've reverted back to using the base system Python. Hope this helps. |
Moreover, enabling a virtualenv also causes YCM to crash. Needless to say, this has been an incredibly frustrating experience as (prior to experimenting with pyenv), YCM just worked with no issues. I'm not sure what changed in my environment to cause these issues, but I've now spent more than 5 hours trying to debug this issue with no luck. |
@danieljaouen I use VIM/GVIM on linux compiled for my python instance from a default virtualenv, no issues. I think I've done the same on OS X when I used it, but setup there was worst because of the way the system setup its defaults (python, gcc, clang, Xcode stuff, homebrew stuff, system stuff, and what not...) |
anyway, it was not YCM fault in any situation, since I figured it out, and just need to setup the system properly. |
@oblitum A YCM error other than:
would be helpful, here. |
And of course, restarting the server just causes it to shut down again with no additional error information. |
things like these helped me set the system properly for compiling and loading correct python, etc for custom compiled MacVim... it's just a sample anyway, I tried to find other links I used but they're broken, so if needed, dig deeper. |
by the way, at the time, I compiled MacVim from git repo cloned by me, not homebrew. I avoided homebrew when it was prone to cause more damage than help. |
I had the same issue.
and YCM server freaks out... Fix/Workaround: cd /usr/bin && sudo ln -s python python2 or add this to vimrc: let g:ycm_path_to_python_interpreter = '/usr/bin/python' |
I've just got back to OS X (because of Swift & Playground) and I had to make a clean install of Mavericks. As of now I have installed everything from homebrew, no problems. The only issue is that, homebrew macvim installation will use the system installed python/ruby, and if you have installed python/ruby from homebrew, then the homebrew build of macvim will use this python/ruby for the build (if you have given homebrew binaries priority over system binaries), because rbenv/pyenv instances are unrelated to the homebrew instances, and stuff built by homebrew should be dependent of homebrew stuff. So what I've done? I've installed a recent ruby/python in homebrew to use as system instance for rbenv/pyenv. I've then installed macvim with homebrew with the rbenv/pyenv system instance as active (again, the one installed by homebrew, not rbenv/pyenv, and which have priority over the ones in I then use other pyenv/rbenv non-system instances for other stuff. There's no way to have a dynamic setting of python instances to be loaded by VIM, since this is set at compilation-time, and hence, set for YCM too. |
@oblitum , Can you try the old version of it? |
On OSX Yosemite (Homebrew Python, pyenv) I installed MacVim with pyenv "off", so above didn't work. When I use |
Nice, so I'd like to correct my statement where I said it's not possible to have a dynamic setting for YCM. |
At a wild guess, YCM isn't designed to work in an environment where the Python "version" is changing all the time (it would probably be necessary to compile YCM for each virtualenv) but since the plugin doesn't need anything specific from the virtualenv (?) compiling against the OSX system Python gives it some Python to use... I think it only uses Python for running the service and connecting to it. I didn't look at the source, C++ scares me. |
It conflicts with pyenv. This fixes it. ycm-core/YouCompleteMe#759
Hello there, I want to use YouCompleteMe for C (with semantic autocompletion) and golang. I dont know how to fix this, setting the python interpreter path for ycm (to /usr/bin/python) did not change anything. |
@Feve2 what are those 30 lines?? |
I've got the same problem as Feve2, except I'm not using clang. Followed the instructions exactly, YCM loads but then crashes immediately with: No indication what the last 30 lines were. :YcmDebugInfo is no help either: Vim -Version: VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 2 2014 19:39:32) I'm trying to use YCM for Javascript, but it crashes in any file. |
|
I'm having the same problem as @Feve2 and @GameKyuubi where I see the following error on vim soon after I go into insert mode:
And nothing else follows. Issuing
cat-ing those two files show:
Vim Version: VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct 27 2015 14:01:33) I should add that when I compiled YCM, it was on a different python version (i.e. 2.7.10). When I work on my Ruby projects, YCM works fine. When I work on a project that uses the the same python version used during YCM install, it works fine too. When I work on a Python version that uses any other Python version (as set by the |
You could try to point |
I encountered the same problem even after doing that. It turns out that
It seems to be working fine now. The second to the last step isn't very portable since I distribute my dotfiles across Mac and Linux systems but I think that's easy enough to fix. |
I ended up here again, a year later -- seems things have moved on. I found that installing Python through rm -rf ~/.pyenv/versions
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.5.3
# now run YCM install script Let's hope my virtualenvs haven't all exploded! |
I think we have it on the README.md#i-get-fatal-python-error-pythreadstate_get-no-current-thread-on-startup now |
Shockingly, this still works |
It's not shocking. It's mentioned in the wiki (and our CI scripts). |
@bstaletic - can you point out where? I only saw I Googled for |
This FAQ talks about The linux CI script: YouCompleteMe/azure/linux/install_dependencies.sh Lines 12 to 14 in 944e7f5
The macOS CI script: YouCompleteMe/azure/macos/install_dependencies.sh Lines 8 to 11 in 944e7f5
|
I've been having considerable difficulty getting YouCompleteMe and pyenv to cooperate. I'm currently running OS X, Homebrew, MacVim (installed via Homebrew), and Python 2.7.6 through pyenv.
First, I tried uninstalling MacVim, running "pyenv global system", re-installing MacVim, then recompiling YouCompleteMe. With this setup, I get the following error:
Next, I tried running "pyenv global 2.7.6", uninstall MacVim, re-installing MacVim (under the assumption my local 2.7.6 will be linked), then re-compiling YouCompleteMe. I get the following error:
Either way, YouCompleteMe is unusable. Any ideas as to what the cause of this is?
The text was updated successfully, but these errors were encountered: