執(zhí)行如下代碼
/usr/bin/python -c "import bz2; print bz2.__doc__"
結果出現(xiàn)如下信息:
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.
說明系統(tǒng)中已經(jīng)安裝了bz2.直接執(zhí)行命令拷貝文件到自己的Python目錄中即可:
cp /usr/lib64/python2.6/lib-dynload/bz2.so /python27/lib/python2.7
問題解決