使用Python 3支持编译vim 8.0导致SIGABRT [英] Compiling vim 8.0 with Python 3 support resulting in SIGABRT
问题描述
我在让Python 3在vim中运行确实遇到了麻烦。我已经从vim github下载了最新的8.0源,并使用包括Python 3.6在内的Anaconda发行版对此进行了配置:
I'm having real trouble getting Python 3 working inside vim. I've downloaded the latest 8.0 source from the vim github, and I've been configuring it with this, using the Anaconda distribution including Python 3.6:
./configure \
--with-features=huge \
--enable-multibyte \
--enable-cscope \
--enable-multibyte \
--enable-python3interp=yes \
--with-features=huge \
--with-python3-config-dir=$ANACONDA_PATH/lib/python3.6/config-3.6m-x86_64-linux-gnu \
--enable-fail-if-missing \
--prefix=$LOCAL_BIN
采用通常的方式( make -j
),安装,运行然后测试 Python 3
包含:
Make the usual way (make -j
), install, then run, test Python 3
inclusion with:
:python3 import sys
然后我得到一个 SIGABRT
杀死vim。我添加了Vundle klen / python-mode
,它在启动时杀死了vim,
And then I get a SIGABRT
killing vim. I added the Vundle klen/python-mode
, which kills vim on startup with:
Fatal Python error: PyThreadState_Get: no current thread
我见过很多人在Mac X的MacPorts /系统捆绑版本的OS X上使用YCM时出现此错误,对此感到困惑。在这里似乎不是这样,我正在运行运行3.16内核的Debian机器,检查 vim --version
显示python3已正确编译,并且指向python3.6库的正确区域(在 / usr / local / lib
中没有冲突):
I've seen a bunch of people have had this error using YCM on OS X with MacPorts / system bundled versions of Python getting confused. That doesn't seem to be the case here, I'm running a Debian machine running 3.16 kernel, checking vim --version
shows that python3 is correctly compiled in, and it points to the correct areas for the python3.6 library (no conflict in /usr/local/lib
):
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Aug 19 2017 11:46:55)
Included patches: 1-966
Compiled by Matt
Huge version without GUI. Features included (+) or not (-):
+acl +file_in_path +mouse_sgr +tag_old_static
+arabic +find_in_path -mouse_sysmouse -tag_any_white
+autocmd +float +mouse_urxvt -tcl
-balloon_eval +folding +mouse_xterm +termguicolors
-browse -footer +multi_byte -terminal
++builtin_terms +fork() +multi_lang +terminfo
+byte_offset +gettext -mzscheme +termresponse
+channel -hangul_input +netbeans_intg +textobjects
+cindent +iconv +num64 +timers
+clientserver +insert_expand +packages +title
+clipboard +job +path_extra -toolbar
+cmdline_compl +jumplist -perl +user_commands
+cmdline_hist +keymap +persistent_undo +vertsplit
+cmdline_info +lambda +postscript +virtualedit
+comments +langmap +printer +visual
+conceal +libcall +profile +visualextra
+cryptv +linebreak -python +viminfo
+cscope +lispindent +python3 +vreplace
+cursorbind +listcmds +quickfix +wildignore
+cursorshape +localmap +reltime +wildmenu
+dialog_con -lua +rightleft +windows
+diff +menu -ruby +writebackup
+digraphs +mksession +scrollbind +X11
-dnd +modify_fname +signs +xfontset
-ebcdic +mouse +smartindent -xim
+emacs_tags -mouseshape +startuptime -xpm
+eval +mouse_dec +statusline +xsmp_interact
+ex_extra -mouse_gpm -sun_workshop +xterm_clipboard
+extra_search -mouse_jsbterm +syntax -xterm_save
+farsi +mouse_netterm +tag_binary
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/home/matt/.local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L/usr/local/lib -Wl,--as-needed -o vim -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lnsl -ldl -L/home/matt/anaconda3/lib/python3.6/config-3.6m-x86_64-linux-gnu -lpython3.6m -lpthread -ldl -lutil -lrt -lm
我还通过 gdb
和 info shared
表示从我的anaconda目录中加载了正确的 libpython3.6
。我真的为此迷失了。有人能想到我所缺少的东西吗?
I also ran this compiled instance through gdb
, and info shared
shows that the correct libpython3.6
is loaded from my anaconda directory. I'm really lost by this. Can anyone think of something I'm missing?
推荐答案
所以我今天正在处理相同的问题,并且设法解决了这个问题通过使用
So I was dealing with same problem today, and I managed to fix it by configuring the VIM compilation with
--enable-python3interp=dynamic
我在 https中找到了建议://github.com/Valloric/YouCompleteMe/issues/2855 。在我的网站上,我什至不需要干预 LD_LIBRARY_PATH
或类似的项目。
I found the advice at https://github.com/Valloric/YouCompleteMe/issues/2855. On my site, I didn't even need to meddle with LD_LIBRARY_PATH
or similar.
这篇关于使用Python 3支持编译vim 8.0导致SIGABRT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!