我在 Debian 机器上从源代码下载并编译了 Python 3.7,但是缺少“readline”功能(查看行历史记录、自动完成选项卡)。我有python3.5使用 安装的软件包apt,并且该功能在那里工作。我已经安装了libreadline7和readline-common包(这些是在我编译 Python 3.7 之前安装的)。我猜我需要在某处编辑/创建一个配置文件,或者我需要在编译期间使用一个标志?我能找到的所有答案都导致“安装readline软件包”,这对我来说已经是这样了。
./configure | grep "readline"Python编译期间的输出:
checking how to link readline libs... none
checking for rl_pre_input_hook in -lreadline... no
checking for rl_completion_display_matches_hook in -lreadline... no
checking for rl_resize_terminal in -lreadline... no
checking for rl_completion_matches in -lreadline... no
checking for append_history in -lreadline... no