非root权限安装bz2

执行如下代码

/usr/bin/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.

说明系统中已经安装了bz2.直接执行命令拷贝文件到自己的Python目录中即可:

cp /usr/lib64/python2.6/lib-dynload/bz2.so  /python27/lib/python2.7  

问题解决

你可能感兴趣的:(非root权限安装bz2)