安裝python的時候遇到的問題,沒法安裝bz2modules等

使用官網的源碼包下載的python:
http://www.python.org/getit/
解壓以後,進行安裝操做:
./configure
make
make報錯信息:
Python build finished, but the necessary bits to build these modules were not found:
_bz2               _curses            _curses_panel  
_dbm               _gdbm              _lzma          
_sqlite3           _tkinter           readline 

此類問題是因爲缺乏一些devel包形成的,以bz2爲例:
yum install bzip2-devel
安裝完成以後,從新make即可
能夠對生成的python文件進行測試:
./python -c "import bz2; print bz2.__doc__"
輸出信息以下:
The python bz2 module provides a comprehensive interface for
the bz2 compression library. It implements a complete file
interface, one shot (de)compression functions, and types for
sequential (de)compression.
即可肯定該包成功安裝。其餘須要的包都是相似的readline-devel,openssl-devel等等 python

相關文章
相關標籤/搜索