使用python编译vim的版本错误
使用使用python编译vim的版本错误,python,vim,Python,Vim,使用 --with-pythoninterp --with-python-config-dir Software/Python-2.7.9/lib/python2.7/config 您可以看到,它似乎是用python2.7.9从输出中编译的 $> python --version Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-2.0 -I/usr/li
--with-pythoninterp --with-python-config-dir Software/Python-2.7.9/lib/python2.7/config
您可以看到,它似乎是用python2.7.9从输出中编译的
$> python --version
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L/usr/local/lib -Wl,--as-needed -o vim -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 -lSM -lICE -lXt -lX11 -lSM -lICE -lm -ltinfo -lnsl -lselinux -L/Software/Python-2.7.9/lib/python2.7/config -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic
然而,当我在VIM中运行以下命令时,似乎检测到的是python 2.7.3(我的系统上没有python 2.7.3)
似乎很奇怪,这里会报告2.7.3。我怀疑这是造成另一个问题,我有
:python import virtualenv;
Traceback (most recent call last):
...
ImportError: Software/Python-2.7.9/lib/python2.7/lib-dynload/_io.so: undefined symbol: _PyLong_AsInt
非常奇怪,因为python似乎是从shell正确设置的
$> echo $PYTHONHOME
Software/Python-2.7.9
$> echo $PYTHONPATH
Software/Python-2.7.9/lib
$> python -c "import virtualenv"
显然,因为我有一个旧的/usr/local版本的python2.7.3没有完全卸载,所以它只是部分使用了它 我从/usr/local中删除了python2.7.3中的所有目录并重新编译,现在它似乎可以工作了
$> echo $PYTHONHOME
Software/Python-2.7.9
$> echo $PYTHONPATH
Software/Python-2.7.9/lib
$> python -c "import virtualenv"