本节内容:
python3添加zlib和bz2支持
1,在linux操作系统中安装zlib和bz2相关库的方法,如下:
复制代码 代码示例:
yum install zlib zlib-devel
yum install bzip2 bzip2-devel
2,重新编译安装python3
复制代码 代码示例:
tar -jxvf Python-3.3.2.tar.bz2
cd Python-3.3.2
./configure && make && make install
3,测试在python3中导入zlib
复制代码 代码示例:
[root@python3_os ~]# python3
Python 3.3.2 (default, Nov 4 2013, 20:12:41)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import zlib;
>>> import bz2;
>>> quit();
>>>查看更多python 教程