簡體   English   中英

從CentOS7上的源代碼編譯Python3.4時無法構建可選模塊readline和_curses

[英]Can't build optional modules readline and _curses when compiling Python3.4 from source on CentOS7

在CentOS 7上從源代碼編譯Python 3.4.3時,自述文件指示運行

./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顯示已安裝readline,但readline命令不起作用

事實證明,此模式對於其他缺少的軟件包也適用。 ssl需要openssl-devel軟件包,而zlib需要zlib-devel

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM