gpt4 book ai didi

python - Mac 上支持 Python 2.x 的 Vim 编译

转载 作者:行者123 更新时间:2023-11-28 21:21:58 31 4
gpt4 key购买 nike

当我运行 vim 时,我得到这个错误:

YouCompleteMe unavailable: requires Vim compiled with Python 2.x support

即使我编译 vim 时:

./configure --with-features=huge \
--enable-rubyinterp \
--enable-pythoninterp \
--with-python-config-dir=/usr/lib/python2.7/config \
--enable-perlinterp \
--enable-gui=gtk2 --enable-cscope --prefix=/usr

根据 these instructions .看起来编译后的 vim 放在 /usr/bin/vim 中,但我也在 /opt/local/bin/vim 中尝试了我的 vim 二进制文件/usr/bin/vi,但我得到了同样的错误。还有哪些其他选项可以使 vim 编译时支持 Python2.x?

编辑

这是 ./configure 的相关输出:

checking --enable-pythoninterp argument... yes
checking for python2... (cached) /usr/bin/python
checking Python version... (cached) 2.7
checking Python is 2.3 or better... yep
checking Python's install prefix... (cached) /System/Library/Frameworks/Python.framework/Versions/2.7
checking Python's execution prefix... (cached) /System/Library/Frameworks/Python.framework/Versions/2.7
(cached) checking Python's configuration directory... (cached) /usr/lib/python2.7/config
(cached) checking if -pthread should be used... no
checking if compile and link flags for Python are sane... no: PYTHON DISABLED

ls/usr/lib/python2.7/config/ 给出:

Makefile           Setup.local        install-sh         makesetup
Setup config.c libpython2.7.a python.o
Setup.config config.c.in libpython2.7.dylib

最佳答案

运行后:xcode-select --install

./config 输出中的这一行从 ... no: PYTHON DISABLED 更改为检查 Python 的编译和链接标志是否正常...是

关于python - Mac 上支持 Python 2.x 的 Vim 编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20303966/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com