用python编译vim有错误的版本

2024-06-28 20:23:19 发布

您现在位置:Python中文网/ 问答频道 /正文

使用

--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中运行以下命令时,似乎检测到了python2.7.3(在我的系统中没有python2.7.3)

:python import sys; print sys.version
2.7.3 (default, Apr 29 2014, 14:50:10)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)]

似乎很奇怪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"

Tags: importconfiggtkincludeversionlibusrwith
1条回答
网友
1楼 · 发布于 2024-06-28 20:23:19

显然,因为我有一个旧的/usr/local版本的python2.7.3没有完全卸载,所以它只是部分地使用它。你知道吗

我从/usr/local中删除了python2.7.3中的所有目录,并重新编译,现在似乎可以工作了

相关问题 更多 >