python - 在 CentOS 上使用 python 2 和 3 安装 Vim;Python 3 版本太旧
问题描述
我正在尝试在 CentOS 上使用 python2 和 python3 支持从源代码编译 Vim,因为 Black 格式化程序需要 python3。我正在关注 YouCompleteMe 指南(https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source)。但是 ./configure 说 python3 太旧了。即使我提供了它,它似乎对运行哪个二进制文件感到困惑。
我已经安装了 python3.6 以及其他几个版本。我读到 Debian 不能同时安装 Vim,但没有提到 RHEL。
这是我的 ./configure 命令:
./configure --with-features=huge \
--enable-multibyte \
--enable-rubyinterp=yes \
--enable-pythoninterp=yes \
--with-python-command=python2.7 \
--with-python-config-dir=/usr/lib64/python2.7/config \
--enable-python3interp=yes \
--with-python3-config-dir=/usr/lib64/python3.6/config-3.6m-x86_64-linux-gnu \
--with-python3-command=python3.6 \
--enable-gui=gtk2 \
--enable-cscope \
--prefix=/usr/local \
--enable-fail-if-missing \
./configure 失败,结果如下:
checking Python version... (cached) 2.7
checking Python is 2.3 or better... yep
checking Python's install prefix... (cached) /usr
checking Python's execution prefix... (cached) /usr
(cached) checking Python's configuration directory... (cached) /usr/lib64/python2.7/config
(cached) checking Python's dll name... (cached) libpython2.7.so.1.0
checking if -pthread should be used... yes
checking if compile and link flags for Python are sane... yes
checking --enable-python3interp argument... yes
checking --with-python3-command argument... python36
checking Python version... (cached) 2.7
checking Python is 3.0 or better... too old
configure: error: could not configure python3
那么......我该如何解决这个问题并让它发挥作用?
解决方案
为 python3 安装开发包
yum install python3-devel*
推荐阅读
- java - Java 语句和指令
- html - chrome如何检测登录文本框?
- post - Apache Solr 在查询结果上应用构面
- c# - 抽象类单例 C#
- c - 在 SDL2 中,相对于窗口所在的屏幕大小(在多个显示器的情况下)调整窗口大小
- mongodb - find_one() 查找不存在的重复项
- java - JSON 提取器 - 提取数据 - 不能应用于原语
- c# - 找到日期 y (可能我们有 1000 个文件 999 有日期 x 和 1 有 y 日期)和相应的文件?
- symfony - 如何为单个实体使用 XML 映射并保持由注释映射的其余实体?
- c# - 当应用程序第二次运行时,来自 API 的数据不会附加到 CSV 文件中