-
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
Can't run MacVim after installing YCM #18
Comments
Currently have the same problem. Followed both the cmake and make procedures which complete fine. Here is my |
I'm seeing the same here, using the version of MacVim installed and linked by homebrew see https://gist.github.com/grncdr/4712845 for the EDIT: just saw #8, I still get the same thing with the binary version of MacVim downloaded from http://code.google.com/p/macvim. I've also tried removing all plugins except vundler and YCM from my config, but I still get the same crash. |
I also get the same crash with MacVim from homebrew and the binary download. I'm also using python 2.7.3 from homebrew. |
Ah that's a clue. |
So it does. Awesome find. Any insights into how that fixed things, anyone? Incidentally, I'm not keen on having to use the system's Python—any way we can patch YMC up to make it play nice with homebrew Python? |
it looks like vim uses libpython. I suspect we need it to use brew's libpython: /usr/local/Cellar/python/2.7.3/lib/libpython2.7.dylib |
Excellent find @grncdr |
super hacky workaround for downloaded vim: DYLD_FORCE_FLAT_NAMESPACE=1 DYLD_INSERT_LIBRARIES=/usr/local/Cellar/python/2.7.3/lib/libpython2.7.dylib /Applications/MacVim.app/Contents/MacOS/Vim I personally have a script called /usr/local/bin/vim that i use to run the brew version: https://gist.github.com/vishvananda/4717499 |
I've patched my homebrew to make the MacVim build use homebrew's python, as otherwise it picked up the system python library and the homebrew python runtime and caused some strange failures in other python plugins. (https://gist.github.com/sgrankin/4719255 for the formula) With that, I had the 'no current thread' error after installing YCM. Adding these flags to the cmake command fixed it: Everything appears to agree on the python being used after that. |
I have this issue too, hope something can be done about it. Btw - if you have python installed as a framework, then you need to point to a different libpython DYLD_FORCE_FLAT_NAMESPACE=1 DYLD_INSERT_LIBRARIES=/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib /Applications/MacVim.app/Contents/MacOS/Vim |
So, even more curious, I removed and reinstalled Homebrew's python, and now everything works fine. Can somebody else confirm? |
@sgrankin additional cmake flags helped. Thanks much... cmake -G "Unix Makefiles" -DPATH_TO_LLVM_ROOT=~/ycm_temp/clang+llvm-3.2-x86_64-apple-darwin11 -DPYTHON_INCLUDE_DIR=/usr/local/Frameworks/Python.framework/Headers -DPYTHON_LIBRARY=/usr/local/Frameworks/Python.framework/Python . ~/.vim/bundle/YouCompleteMe/cpp I would probably add this to the doc as many python dev's build vim/mvim using homebrew's python |
@sgranking Am I correct in summarizing this thread by saying that the fix is to call |
I did not upgrade python nor reinstall vim or mvim. I just did pointed cmake to the homebrew framework dirs. (previously install brew install python --framework).
|
I don't use python --framework but after uninstalling python with brew and reinstalling, my next build of macvim used the system pythonlib so it is now working without modification |
@Valloric More like |
I'm closing this since it's a configuration issue and sadly not something that can be fixed on YCM's side. I've added a new FAQ item for this (that also links to this issue) and noted it in the Mac installation guide. |
I think the instructions in the FAQ are insufficient as I just got done going through hell trying to figure out why after installing brewed python vim suddenly started segfaulting and it turns out to be this plugin. The real fix here is to add the LD flags suggested earlier to the cmake command so that cmake finds the brewed version of python. Perhaps we can add an additional flag to the install.sh script? For reference, here is what I had to change with the install.sh:
|
Did a little more digging and it appears other brew formula have 'work arounds' in their installation scripts that YouCompleteMe could borrow from: See: Of particular interest: |
http://stackoverflow.com/a/12697440/1742820 Here is a workaround that works for me. |
I think that the FAQ item regarding this is still not as helpful as it could be. This isn't particular to homebrew in any way. I had python installed as a framework under Homebrew-MacVim also uses system python (unless the user figures out how to link it against a different one, with the symlinking hack or some other way). This will likely get fixed at some point (either by a workaround in the homebrew formula or better detection by MacVim at compile time). The binary MacVim distribution, of course, always links against system python. So as it stands, the majority of MacVim users will have a MacVim linked against system python (but some won't). Many users won't have some other python installed (but some will). I think that it just needs to be made clear that YCM is going to compile against whatever python (and python-config, which should match) it finds in the PATH. Unless there's a way to reliably determine which python is being used by vim (and I haven't been able to figure out a reliable way... |
I found the problem here is similar to the problem here. SirVer's solution of changing the python worked for me. |
This problem annoys me for days and I finally came to a solution as below:
Hope somebody find this useful. |
@noscripter your general solution worked for me, i also had to do a |
For homebrew it should actually be something like
which uses default homebrew linked thing. |
@imkira's suggestion (to edit
Note that /usr/local/bin/python2.7 is symlinked to brew's python in /usr/local/Cellar… Before this CmakeLists.txt edit,
Once these two matched, I thought I was home free. But MacVim was still crashing with ABRT! The other half involved forcing MacVim, which I was building from source per the YCM docs, to use brew's Python. Turns out it was built using system python: remove YouCompleteMe/ from
The "(cached)" seemed a problem so I deleted (If MacVim's configure was still finding system python, I'd have tried the solutions on SO to get MacVim to find the right Python. But it looks like Moved YouCompleteMe back into (This was all on Mavericks. Interestingly, I also installed MacVim from github and YCM on a fresh clean Yosemite this morning and didn't run into |
Following @imkira's suggestion as well as @fasiha's I almost got everything working, but in the end the only thing that solved it for me was finally taking @Valloric's advice in the README and installing MacVim directly, rather than using homebrew or trying to work with another version of vim. If you're having this problem and did not build MacVim yourself, I highly recommend you try this first. |
This worked for me. Hope it helps someone else. NOTE: the 2.7.10 portion needs to be the latest version you have installed with Homebrew
Update: 8/4/2015 |
@harciga solution works for me |
@jmeridth Also works for me... |
Another way to get things working, taking a page from the OS X install in YCM's readme:
Now everything should work as expected and you didn't have to mess with system Python. |
+1 @rfurman |
I resolved by removing redundant python. For me seems it's because if my OSX has different version of python installed, from System, from homebrew, from Xcode etc. So use:
to see where are those python installed and remove them. Seems I can't remove the one come with the system:
so I kept that one and remove all others like:
Then go to Ycm and run:
to recompile and install ycm. Then it works for me. |
@ActionScripted nice, that worked for me. |
For the record: I have found that if using pyenv to install python and you get the infamous
Then you must add the
|
Correction. That works for python 3.5, but it looks like pyenv can't build --enable-shared on some versions (like 3.3.6). Better to try:
|
I face the same error. cause I have three python 2.7 install. one system. one download from the python.org, one install from brew. I fixed it with the following. hope may help others.
now it works. |
@hackrole Ha! Thank you! |
@hackrole's solution also worked for me, thank you very much 👍 |
Recently I install a python 2.7.12 apart from the system one 2.7.10 and face the same error. But maybe because I did not install the macvim by homebrew before, below works for me. -- No uninstalling python and macvim. -- rebuild YCM I think it may be not necessary to reinstall the homebrew's python because this error is only related to the python configuration in MacVim and YouCompleteMe. And if you have a homebrew's python, when it is about to build the MacVim, it should know to configure it with the homebrew's one. The same as the YouCompleteMe. Anyway, thanks all and especially to @hackrole . |
Just figure it out, it's mainly because the _io.so file is different in python 2.6 / 2.7.5 / 2.7.13, so if you still want to use the homebrew version python in terminal using "python", you should copy the old version io.so file into the 2.7.13 directory. First, run the following code in terminal sudo find / -name _io.so Here is mine: Second, copy the 2.7.13 version io file to backup cd Desktop
mkdir backup_python
cp /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so backup_python/2.7.13_io.so Third, copy the old version to replace the new one cp /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so Then it will be all set! |
Thanks samueljon, changing to python 3 by add python flag: --enable-python3interp vi_cv_path_python3=/usr/local/bin/python3 by editing "brew edit macvim" works for me |
uninstalling brew installed python2.X worked for me. |
I installed YCM as per the instructions on the readme, and now MacVim crashes immediately after starting.
Running it in the terminal I get—
I'm running MacVim 7.3 (snapshot 66) for OS X 10.8 (Mountain Lion), as downloaded from the official Google Code project page.
Running plain old Vim (which IIRC I brew installed), I get—
When I ran
:BundleInstall Valloric/YouCompleteMe
, MacVim didn't crash—but then I'm not sure if it required an reboot to fully "install".The text was updated successfully, but these errors were encountered: