为什么 Ubuntu 20.04 中的 Vim 需要 Python 3?

use*_*216 13 vim python apt python3

我正在使用 Docker,我的dockerfile是:

######################################################
FROM ubuntu:20.04

WORKDIR /opt/test

# Apt installs
RUN apt update

######################################################
Run Code Online (Sandbox Code Playgroud)

如果我构建并运行容器,然后运行以下命令,它会要求安装 python3-minimal 和 Python 依赖项:

$ docker run -it ubuntu-test
root@3a13a90d3e86:/opt/test# apt install vim
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  alsa-topology-conf alsa-ucm-conf file libasound2 libasound2-data libcanberra0 libexpat1 libgpm2 libltdl7 libmagic-mgc libmagic1 libmpdec2 libogg0 libpython3.8 libpython3.8-minimal libpython3.8-stdlib libreadline8 libsqlite3-0
  libssl1.1 libtdb1 libvorbis0a libvorbisfile3 mime-support readline-common sound-theme-freedesktop vim-common vim-runtime xxd xz-utils
Suggested packages:
  libasound2-plugins alsa-utils libcanberra-gtk0 libcanberra-pulse gpm readline-doc ctags vim-doc vim-scripts
The following NEW packages will be installed:
  alsa-topology-conf alsa-ucm-conf file libasound2 libasound2-data libcanberra0 libexpat1 libgpm2 libltdl7 libmagic-mgc libmagic1 libmpdec2 libogg0 libpython3.8 libpython3.8-minimal libpython3.8-stdlib libreadline8 libsqlite3-0
  libssl1.1 libtdb1 libvorbis0a libvorbisfile3 mime-support readline-common sound-theme-freedesktop vim vim-common vim-runtime xxd xz-utils
0 upgraded, 30 newly installed, 0 to remove and 25 not upgraded.
Need to get 14.9 MB of archives.
After this operation, 70.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Run Code Online (Sandbox Code Playgroud)

这些文件在列表中: libpython3.8 libpython3.8-minimal libpython3.8-stdlib

为什么 Vim 需要 Python?

(这弄乱了我的 Docker 映像,因为我实际上需要 Vim,但我还需要 32 位 Python。所以我需要 python3:i386,但 Vim 也通过安装 64 位 Python 搞乱了它)。

And*_*her 25

我猜这个包vim在支持python 的情况下编译的。您可能会更幸运地安装该软件包vim-tiny


mur*_*uru 16

这在 20.04 中并不新鲜。在18.04 中也是如此(当然,用 Python 3.6 代替)。在16.04 中,一旦修复了回归LP #1574897)。甚至在 12.04 中,vim包也依赖于 Python(当时为 2.7)。这支持 Vim 中的 Python 脚本。


gui*_*erc 6

开发人员将其列为需要 - https://packages.ubuntu.com/focal/vim

您的选择也可以使用vi,而不是

https://packages.ubuntu.com/focal/nvi

这表明没有python3要求。