YCM does not work for the reason given above. When I type :python import sys; print sys.version I obtain:

2.7.9 (default, Dec 13 2014, 15:13:49)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)]

but when I compiled YCM, I set it up to use /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7. Doing ./python2.7 --version in this folder returns 2.7.10.

I figured I could recompile vim and make it use the same python in /System/Library/Frameworks/Python.framework/Versions/2.7/bin, but I don't see a way to do so. The option --with-python-config-dir=PATH doesn't seem to do much. In fact I can see in the config.log

configure:5872: checking for python
configure:5890: found /usr/bin/python
configure:5902: result: /usr/bin/python
configure:5915: checking Python version
configure:5924: result: 2.7
configure:5927: checking Python is 2.3 or better
configure:5932: result: yep
configure:5935: checking Python's install prefix
configure:5944: result: /System/Library/Frameworks/Python.framework/Versions/2.7
configure:5947: checking Python's execution prefix
configure:5956: result: /System/Library/Frameworks/Python.framework/Versions/2.7
configure:5978: checking Python's configuration directory
configure:6000: result: /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config
configure:6059: checking Python's dll name
configure:6072: result: Python.framework/Versions/2.7/Python
configure:6088: checking if -pthread should be used
configure:6130: result: no
configure:6141: checking if compile and link flags for Python are sane
configure:6158: gcc -o conftest -g -O2 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -DPYTHON_HOME='"/System/Library/Frameworks/Python.framework/Versions/2.7"'  -DMACOS_X_UNIX  -L/usr/local/lib conftest.c  -framework Python >&5

It looks like it will use also /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7, but when I compile and type :python import sys; print sys.version I still get 2.7.9. The python in /usr/bin/python is also 2.7.10 and it's not a symlink to /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7. This could be conflicting I guess. I also wanted to see where the python vim is using is by typing python import sys; print sys.executable, but this returns the vim bin, not python. Any suggestions? Thanks.


1 Answer 1


I was able to solve this issue by using the command lsof -p PID. This gave me the python vim was using (which I couldn't find with sys.executable). Then I realized I was including this directory in DYLD_FRAMEWORK_PATH in my .bash_profile. I just deleted it and vim could pick up the correct python version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.