python - 在 CentOS7 上从源代码编译 Python3.4 时无法构建可选模块 readline 和 _curses

标签 python python-3.x centos readline

在 CentOS 7 上从源代码编译 Python 3.4.3 时,README 指示运行

./configure
make
make test
sudo make install

在第二步,make,我明白了

Python build finished successfully!
The necessary bits to build these optional modules were not found:
_bz2                  _curses               _curses_panel
_dbm                  _gdbm                 _lzma
_sqlite3              _ssl                  _tkinter
readline              zlib
To find the necessary bits, look in setup.py in detect_modules() for the module's name.

但是 setup.py 的源代码中没有任何内容表明要做什么?好像我已经有了必需的包?

$ sudo yum install readline
...
Package readline-6.2-10.el7.x86_64 already installed and latest version
Nothing to do

如何获取 python 3 的 readline 模块?

最佳答案

安装readline-devel

$ sudo yum install readline-devel
[...]
Installed:
  readline-devel.x86_64 0:6.2-10.el7

Dependency Installed:
  ncurses-devel.x86_64 0:5.9-14.20130511.el7_4

Dependency Updated:
  ncurses.x86_64 0:5.9-14.20130511.el7_4   [...]

Complete!

然后重新运行make

$ make
[...]
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_bz2                  _dbm                  _gdbm
_lzma                 _sqlite3              _ssl
_tkinter              zlib

现在,readline_curses 模块均已安装,并且不在缺失模块列表中。

我从这个问题的答案中得到了提示:yum showing readline installed but readline command not working

事实证明,这种模式对于其他缺失的软件包非常有效。 ssl 需要 openssl-devel 软件包,zlib 需要 zlib-devel

关于python - 在 CentOS7 上从源代码编译 Python3.4 时无法构建可选模块 readline 和 _curses,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49763362/

相关文章:

ajax - "XML Parsing Error: XML or text declaration not at start of entity"在 CentOS 中,而在 Tomcat 中运行良好

python - 将张量列表转换为张量 pytorch

python - 分配给属性引用时出现类型错误?

amazon-ec2 - 指向不同的 yum 存储库

python-3.x - python 诗歌如何为所有用户安装ubuntu 18.04?

python - 在 Python 中绘制棋盘

apache - 无法在centos服务器上启动apache,没有报错,只是超时

python - 为什么 python 2.6 不更新我的 numpy 数组?

python - Pandas DataFrame.hist() 不起作用

python - 如何在Python中按间隔时间重置循环