gpt4 book ai didi

linux - YouCompleteMe 不可用 : unable to load Python

转载 作者:行者123 更新时间:2023-12-05 01:37:11 26 4
gpt4 key购买 nike

我使用 Linux CentOS-7-x86_64 并尝试使用 vundle 安装 YouCompleteMe。我收到错误:

YouCompleteMe unavailable: unable to load Python.

但是,当我输入 vim --version 时,我得到:

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Apr 13 2020 22:48:56)
Included patches: 1-577
Compiled by louqinjian@localhost.localdomain
Huge version without GUI. Features included (+) or not (-):
+acl -farsi +mouse_sgr +tag_binary
+arabic +file_in_path -mouse_sysmouse -tag_old_static
+autocmd +find_in_path +mouse_urxvt -tag_any_white
+autochdir +float +mouse_xterm -tcl
-autoservername +folding +multi_byte +termguicolors
-balloon_eval -footer +multi_lang +terminal
+balloon_eval_term +fork() -mzscheme +terminfo
-browse +gettext +netbeans_intg +termresponse
++builtin_terms -hangul_input +num64 +textobjects
+byte_offset +iconv +packages +textprop
+channel +insert_expand +path_extra +timers
+cindent +ipv6 +perl +title
-clientserver +job +persistent_undo -toolbar
-clipboard +jumplist +popupwin +user_commands
+cmdline_compl +keymap +postscript +vartabs
+cmdline_hist +lambda +printer +vertsplit
+cmdline_info +langmap +profile +virtualedit
+comments +libcall +python/dyn +visual
+conceal +linebreak +python3/dyn +visualextra
+cryptv +lispindent +quickfix +viminfo
+cscope +listcmds +reltime +vreplace
+cursorbind +localmap +rightleft +wildignore
+cursorshape +lua +ruby +wildmenu
+dialog_con +menu +scrollbind +windows
+diff +mksession +signs +writebackup
+digraphs +modify_fname +smartindent -X11
-dnd +mouse -sound -xfontset
-ebcdic -mouseshape +spell -xim
+emacs_tags +mouse_dec +startuptime -xpm
+eval -mouse_gpm +statusline -xsmp
+ex_extra -mouse_jsbterm -sun_workshop -xterm_clipboard
+extra_search +mouse_netterm +syntax -xterm_save
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: "/usr/local/share/vim"
Compilation: gcc -std=gnu99 -c -I. -Iproto -DHAVE_CONFIG_H -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -std=gnu99 -L. -Wl,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,--enable-new-dtags -Wl,-rpath,/usr/lib64/perl5/CORE -L/usr/local/lib -Wl,--as-needed -o vim -lm -ltinfo -lselinux -ldl -L/usr/lib -llua -Wl,--enable-new-dtags -Wl,-rpath,/usr/lib64/perl5/CORE -fstack-protector -L/usr/lib64/perl5/CORE -lperl -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc -lruby -lpthread -lrt -ldl -lcrypt -lm

并且,当我使用 .configure 安装 vim 时,我包括

--with-features=huge --enable-python3interp --enable-pythoninterp

我该怎么做才能解决这个问题?

最佳答案

我建议你去你的 ~/.vimrc 并在你开始你的插件声明之前将它添加到文件的开头。

if has('python3')
endif

~/.vimrc 示例:

if has('python3')
endif

call plug#begin('~/.vim/plugged')
Plug 'https://github.com/ycm-core/YouCompleteMe.git'
call plug#end

从那里你可以

:PlugInstall 

然后 cd 到你的 YouCompleteMe 目录。如果您安装了 Anaconda,请确保不要将其与它一起安装。

改用/usr/bin python。

例子:

/usr/bin/python3 install.py --all

最后,一旦一切就绪并完成,请重新启动计算机并再次打开 Vim。

我使用 https://github.com/junegunn/vim-plug 安装了 YouCompleteMe但只要你的 vimrc 中有“if”语句,它就应该可以工作。

关于linux - YouCompleteMe 不可用 : unable to load Python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61240101/

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