python - Windows : VIM doesn't find Python3 上的 GIT bash

标签 python windows git vim mingw-w64

早上好,我的 VIM 无法在 Windows 上找到我的 Python 安装。 预先感谢所有花时间阅读此问题的人:)

我当前的设置 我目前在 Windows 上的 GIT Bash 中运行 VIM 8.0.27(来自 https://git-scm.com/download/win 的未修改的 64 位设置)。此外,我在以下目录中安装了 64 位版本的 Python 3.5.2:“C:/Python35/” 我已将“C:/Python35/”和“C:/Python35/Scripts/”添加到我的PATH 变量。 VIM 似乎是用 Python 支持编译的,因为版本文本包括 “+python/dyn”和“+python3/dyn”

我的问题

在我看来,VIM 无法找到我的 python 安装。 当我调用 ":echo has('python')"或 ":echo has('python3')" 时,它返回 0。 当我尝试在安装了 python 插件的情况下启动 VIM 时收到以下错误消息:“UltiSnips 需要 py >= 2.7 或 py3”

长期目标

我的目标是让 Greg Hurrel 的 VIM 配置在 Windows 7 上启动并运行 (https://github.com/wincent/wincent)。除其他外,它需要 Python 和 Ruby。我也很感激有关实现此目标的其他(更好)方法的提示。

详情

$ which python35.dll

/c/Python35/python3.dll

在 vim 中: ":echo $PATH"

/c/Users/JannikV/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/JannikV/bin:/c/Python35/Scripts:/c/Python35:/c/Program Files/Intel/iCLS Client:/c/Windows/system32: ...

$ vim --version

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Oct 12 2016 13:28:14)
Included patches: 1-27
Compiled by <alexpux@gmail.com>
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      +terminfo
++builtin_terms  +fork()          +multi_lang      +termresponse
+byte_offset     +gettext         -mzscheme        +textobjects
+channel         -hangul_input    +netbeans_intg   +timers
+cindent         +iconv           +num64           +title
-clientserver    +insert_expand   +packages        -toolbar
+clipboard       +job             +path_extra      +user_commands
+cmdline_compl   +jumplist        +perl/dyn        +vertsplit
+cmdline_hist    +keymap          +persistent_undo +virtualedit
+cmdline_info    +lambda          +postscript      +visual
+comments        +langmap         +printer         +visualextra
+conceal         +libcall         +profile         +viminfo
+cryptv          +linebreak       +python/dyn      +vreplace
+cscope          +lispindent      +python3/dyn     +wildignore
+cursorbind      +listcmds        +quickfix        +wildmenu
+cursorshape     +localmap        +reltime         +windows
+dialog_con      -lua             +rightleft       +writebackup
+diff            +menu            +ruby/dyn        -X11
+digraphs        +mksession       +scrollbind      -xfontset
-dnd             +modify_fname    +signs           -xim
-ebcdic          +mouse           +smartindent     -xpm
+emacs_tags      -mouseshape      +startuptime     -xsmp
+eval            +mouse_dec       +statusline      -xterm_clipboard
+ex_extra        -mouse_gpm       -sun_workshop    -xterm_save
+extra_search    -mouse_jsbterm   +syntax
+farsi           +mouse_netterm   +tag_binary
   system vimrc file: "/etc/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: "/etc"
 f-b for $VIMRUNTIME: "/usr/share/vim/vim80"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -D_FORTIFY_SOURCE=2 - I/usr/include/ncursesw  -march=x86-64 -mtune=generic -O2 -pipe -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L. -pipe -fstack-protector -pipe -Wl,--as-needed -o vim.exe        -lm    -lncursesw -liconv -lacl -lintl   -pipe -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -fstack-protector-strong  -L/usr/lib/perl5/core_perl/CORE -lperl -lpthread -ldl -lcrypt`

最佳答案

经过很多努力,我终于让 python 在 Windows 10 上与 gvim 8.0 一起工作。 secret 是它必须是 python 版本 2.7.0(更高版本可能有效,2.7.13 无效)。

我还安装了 python 3.6,以便在实际进行 python 编程时使用。

python 2.7.0 不在我的 PATH 环境变量中,但我怀疑这无关紧要。

关于python - Windows : VIM doesn't find Python3 上的 GIT bash,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41138426/

相关文章:

git - 如何通过提交的 SHA 获取文件和内容

python - 非常基本的 python 字符串

python - 安装了tensorflow,但是pycharm忽略了它

c - Windows 用户空间文件系统是最佳选择吗?

c++ - 获取事件 udp 连接的目标 IP/端口?

git - 用户名或密码无效。位桶

Python:在类实例初始化之前修改传递的参数

python - 调用以某物开头的类的所有方法

c - fgetc 需要 'enter' 在 WINDOWS 上按两次键

git - 多个 git origins/remotes 和 checkout 分支